This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from functools import wraps | |
class SometimesClassmethod: | |
def __init__(self, wrapped_function): | |
self._wrapped = wrapped_function | |
def __get__(self, instance, owner=None): | |
if instance is None: | |
return self._class_call(owner) |
OlderNewer