3 ms·
Very nice; it does seems far more reasonable to implement this as a decorator than as an explicit function call __init__.
by reuven 13y ago
Very nice; it does seems far more reasonable to implement this as a decorator than as an explicit function call __init__.
- stormbrew 13y agoOne thing I like a lot better about it in particular is that it doesn't reach into the stack frame, which strikes me as a very messy grab at internals people should never ever touch. The arity and name information from the compiled function object, however, has legitimate use in tooling and I suspect a lot of decorators do this sort of thing. It's an interesting balance between one being more magical in its use of the system (inspecting live stack frames) and the other being more magical in appearance (having a function with just pass in it actually do something).