super() doesn't get superclass
Ben Finney
bignose+hates-spam at benfinney.id.au
Wed Sep 19 01:48:08 EDT 2007
Dennis Lee Bieber <wlfraed at ix.netcom.com> writes:
> Try to interpret it as:
My point exactly. If a function is named 'super' and operates on
classes, it's a pretty strong implication that it's about
superclasses. Any explanation that begins "Try to interpret it as" and
then goes on to explain that it's to do with MRO, *not* superclasses,
is evidence that the function is *badly named*.
I'm not interested in documenting this function, because as I said I
don't see why I would want to use it. My objection is that, as
currently named, it's an *obstacle* when a programmer goes looking for
a way to get a superclass.
Possibly the name 'next_in_mro', while ugly, would at least match the
actual behaviour of this function.
At least then the next person who goes looking for "how do I get the
superclass of A?" won't be misled into trying to use *the wrong
function for that purpose*.
--
\ "If you can't annoy somebody there is little point in writing." |
`\ -- Kingsley Amis |
_o__) |
Ben Finney
More information about the Python-list
mailing list