Created
December 20, 2018 17:54
-
-
Save Zheaoli/f2a098bbeff4282012a0913b87b28d55 to your computer and use it in GitHub Desktop.
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
class BaseMetaClass(type): | |
""" | |
装饰器元类 | |
""" | |
def __new__(mcs, name, bases, namespace): | |
namespace['get_data'] = cache_wrap(namespace['get_data']) | |
return super().__new__(mcs, name, bases, namespace) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment