[Python-Dev] PEP 487 vs 422 (dynamic class decoration) (original) (raw)
Ethan Furman ethan at stoneleaf.us
Fri Apr 3 05:05:19 CEST 2015
- Previous message (by thread): [Python-Dev] PEP 487 vs 422 (dynamic class decoration)
- Next message (by thread): [Python-Dev] PEP 487 vs 422 (dynamic class decoration)
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On 04/03, Greg Ewing wrote:
On 04/03/2015 02:31 PM, Nick Coghlan wrote:
If I'm understanding PJE's main concern correctly it's that this approach requires explicitly testing that the decorator has been applied correctly in your automated tests every time you use it, as otherwise there's a risk of a silent failure when you use the decorator but omit the mandatory base class that makes the decorator work correctly. Could the decorator be designed to detect that situation somehow? E.g. the first time the decorated method is called, check that the required base class is present.
That feels like a horrible work-around. The proper place for setup code is in the set up.
-- ~Ethan
- Previous message (by thread): [Python-Dev] PEP 487 vs 422 (dynamic class decoration)
- Next message (by thread): [Python-Dev] PEP 487 vs 422 (dynamic class decoration)
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]