News for hackers. Stuff that matters.
Re:Making Python's __init__ method magical by reuven on Friday January 03, 2014 @07:43AM (#7005154)
Very nice; it does seems far more reasonable to implement this as a decorator than as an explicit function call __init__.
Re:Making Python's __init__ method magical by stormbrew on Friday January 03, 2014 @08:20AM (#7005258)
One 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).