mirror of
https://github.com/FlipsideCrypto/web3.py.git
synced 2026-02-06 19:06:52 +00:00
16 lines
424 B
Python
Executable File
16 lines
424 B
Python
Executable File
import functools
|
|
|
|
|
|
class combomethod(object):
|
|
def __init__(self, method):
|
|
self.method = method
|
|
|
|
def __get__(self, obj=None, objtype=None):
|
|
@functools.wraps(self.method)
|
|
def _wrapper(*args, **kwargs):
|
|
if obj is not None:
|
|
return self.method(obj, *args, **kwargs)
|
|
else:
|
|
return self.method(objtype, *args, **kwargs)
|
|
return _wrapper
|