You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sometime we need a decorator to work on instance (not class itself), but we do not have any method / property for it, these usually comes with metadata additions:
Such decorators only add additional metadata so it can be used in runtime. I know it could be archived with class decorator and class inheritance but it's really not that intuitive.
I propose decorators could be used on constructor, which works when an instance is created just like method decorators, but constructor decorators does not descriptor argument, and the key argument is "constructor"
The text was updated successfully, but these errors were encountered:
Sometime we need a decorator to work on instance (not class itself), but we do not have any method / property for it, these usually comes with metadata additions:
Such decorators only add additional metadata so it can be used in runtime. I know it could be archived with class decorator and class inheritance but it's really not that intuitive.
I propose decorators could be used on constructor, which works when an instance is created just like method decorators, but constructor decorators does not
descriptor
argument, and thekey
argument is"constructor"
The text was updated successfully, but these errors were encountered: