Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Base:
- __handlers = []
- @staticmethod
- def handler(cls):
- def wrapper():
- Base.add_handler(cls)
- wrapper()
- @classmethod
- def add_handler(cls, view):
- cls.__handlers.append(view)
- class View:
- pass
- @Base.handler
- class First(View):
- pass
- bot = Base()
- print(bot._Base__handlers)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement