This file contains 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
class classmethod_: | |
"""Allows using a classmethod also as an instance method""" | |
def __init__(self, cls_method, inst_method=None): | |
self.cls_method = cls_method | |
self.inst_method = inst_method | |
def __get__(self, obj, objtype=None): | |
if obj is not None: | |
return lambda *args: self.inst_method(obj, *args) | |
if objtype is None: |