def __call__(self, f):
"""
Method call wrapper. As this decorator has arguments, this method will
only be called once as a part of the decoration process, receiving only
one argument: the decorated function ('f'). As a result of this kind of
decorator, this method must return the callable that will wrap the
decorated function.
"""
if isinstance(f, property):
f.fget._aliases = self.aliases
else:
f._aliases = self.aliases
return f
评论列表
文章目录