Allow allow_lazy to be used as a decorator
|Reported by:||void||Owned by:||bmispelon|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
allow_lazy cannot be used as a decorator for now, at least not in @-notation, because *resultclasses is required argument for this function. Decorator with arguments are functions, which accept arguments, returning function, which decorates source function. In allow_lazy signature arguments and function are mixed.
So, proposal is to distinguish on type: if first argument of allow_lazy is of type type, then treat it like a three-def-decorator, while allowing current two-def-decorator behaviour if first argument is a function.
Change History (5)
comment:1 Changed 2 years ago by bmispelon
- Cc bmispelon@… added
- Needs documentation unset
- Needs tests unset
- Patch needs improvement unset
- Triage Stage changed from Unreviewed to Accepted
comment:3 Changed 2 years ago by bmispelon
- Owner changed from nobody to bmispelon
- Status changed from new to assigned