News for hackers. Stuff that matters.
Re:Sh.py by riffraff on Monday September 17, 2012 @02:22AM (#4531473)
for those wondering how "import madeupname" works, basically the incantation is:

    # unless __name__ == "__main__" 
    self = sys.modules[__name__]
    # SelfWrapper has a custom __getattr__
    sys.modules[__name__] = SelfWrapper(self) 
which seems somewhat unpythonesque (aren't import hooks supposed to be used for this?) but it's cool and I hadn't seen it before.
Re:Sh.py by fijal on Monday September 17, 2012 @02:26PM (#4534032)
import hooks leave crap in your global state. this only modifies sys.modules, which is probably a much better option.