[Python-3000] Problems with the new super()

Guido van Rossum guido at python.org
Fri May 2 05:54:33 CEST 2008


This whole movement to condemn super because it's not "pure" strikes
me as wasted energy. That's my last word.

On Thu, May 1, 2008 at 8:28 PM, Georg Brandl <g.brandl at gmx.net> wrote:
> Guido van Rossum schrieb:
>
>
> > On Thu, May 1, 2008 at 11:20 AM, Georg Brandl <g.brandl at gmx.net> wrote:
> >
> > >  But the other two magical things about super() really bother me too. I
> > >  haven't looked at the new super in detail so far (and I don't know how
> > >  many others have), and two things are really strikingly unpythonic in
> > >  my view:
> > >
> > >  * super() only works when named "super" [1]. It shouldn't be a function
> if
> > >  it has that property; no other Python function has that.
> > >
> >
> > Actually, I believe IronPython and/or Jython have to use this trick in
> > certain cases -- at least I recall Jim Hugunin talking about
> > generating different code when the use of locals() was detected.
> >
>
>  I don't know if it's possible in Jython to have "locals" referring to
>  something else. For CPython, the name "super" in a function can refer to
>  anything -- local, global or builtin -- and it just feels wrong for the
>  compiler to make assumptions based on the mere mention of a non-reserved
>  name.
>
>
>
> > I'm not proud of this, but I don't see a way around it. The
> > alternative would be to make it a keyword, which seemed excessive
> > (plus, it would be odd if super() were a keyword when self is not).
> >
>
>  I don't find it odd. In fact, IMO the whole magic needed for the runtime
>  implementation of "super()" justifies super becoming a keyword.
>
>  Georg
>
>  [Moving this to the Python-3000 list]
>
>
>  --
>  Thus spake the Lord: Thou shalt indent with four spaces. No more, no less.
>  Four shall be the number of spaces thou shalt indent, and the number of thy
>  indenting shall be four. Eight shalt thou not indent, nor either indent
> thou
>  two, excepting that thou then proceed to four. Tabs are right out.
>
>  _______________________________________________
>  Python-3000 mailing list
>  Python-3000 at python.org
>  http://mail.python.org/mailman/listinfo/python-3000
>  Unsubscribe:
> http://mail.python.org/mailman/options/python-3000/guido%40python.org
>



-- 
--Guido van Rossum (home page: http://www.python.org/~guido/)


More information about the Python-3000 mailing list