Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Could you (or anyone else) elaborate on the issues with super() as described in this article? I'm having a hard time understanding what's going on between the complex details of the problem and the author's cumbersome syntactic choices.


The super() is magical. Functions aren't supposed to magically know what class or instance they are in unless they are explicitly passed on in Python. That's why you see the "self" argument in methods.

And in the 2nd example, he shows that if you copy super to another name, then it doesn't work. Presumably meaning that super which looks like a function, actually acts like a compiler keyword in certain cases.


I'm not sure if this is really clear, but it's better: http://docs.python.org/library/functions.html#super




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: