Created
November 17, 2019 16:53
-
-
Save antvconst/b5e39a9e594a8e1d559400c59f71379c to your computer and use it in GitHub Desktop.
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
import functools | |
class classmethod(object): | |
def __init__(self, f): | |
self.f = f | |
def __get__(self, owner, owner_type): | |
@functools.wraps(self.f) | |
def wrapper(*args, **kwargs): | |
return self.f(owner_type, *args, **kwargs) | |
return wrapper | |
class staticmethod(object): | |
def __init__(self, f): | |
self.f = f | |
def __get__(self, owner, owner_type): | |
@functools.wraps(self.f) | |
def wrapper(*args, **kwargs): | |
return self.f(*args, **kwargs) | |
return wrapper |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment