News for hackers. Stuff that matters.
Re:Wield Python's super() like a Jedi by kalelias on Thursday May 26, 2011 @01:38PM (#2588666)
tl;dr

Just looks like super/parent like in other languages. Did i miss something from not reading this?

Re:Wield Python's super() like a Jedi by masklinn on Thursday May 26, 2011 @01:48PM (#2588700)
> Did i miss something from not reading this?

Everything? Mostly the part where, Python being an MI language, a given class A has multiple parents. And these parents are a sequence, not a set, which define a Method Resolution Order, and that method resolution order usually isn't breadth-first either, so Python's super is a graph walker. And because it's explicit, any node in the graph can stop the walking.

This means permuting two parent classes can have significant impact on the semantics of the graph walking, therefore the results of calling super.

Re:Wield Python's super() like a Jedi by kalelias on Friday May 27, 2011 @03:36AM (#2590721)
Thanks for the short explanation. I totally forget about python being MI.
Re:Wield Python's super() like a Jedi by silentbicycle on Thursday May 26, 2011 @02:24PM (#2588872)
Some small steps in the direction of a meta-object protocol: more fine-grained control over call dispatch in a multiply-inheriting class hierarchy.
Re:Wield Python's super() like a Jedi by smosher on Thursday May 26, 2011 @06:44PM (#2589699)
You didn't miss as much as others seem to think. Nothing here changes the fact that it subverts the object model and overuse causes kudzu.
Re:Wield Python's super() like a Jedi by kalelias on Friday May 27, 2011 @03:52AM (#2590752)
Yeah, OO is too hard.
Re:Wield Python's super() like a Jedi by Peristarkawan on Thursday May 26, 2011 @01:50PM (#2588710)
Yes, Python's super is more like Dylan's next-method than, say, C#'s super.
Re:Wield Python's super() like a Jedi by pdubroy on Thursday May 26, 2011 @01:48PM (#2588704)
Yes.