A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2006-December/070416.html below:

[Python-Dev] classes and cell variables question

[Python-Dev] classes and cell variables question [Python-Dev] classes and cell variables questionGuido van Rossum guido at python.org
Fri Dec 29 22:23:14 CET 2006
On 12/29/06, tomer filiba <tomerfiliba at gmail.com> wrote:
> On 12/29/06, Jeremy Hylton <jeremy at alum.mit.edu> wrote:
> > def spam():
> >   x = 5
> >   class eggs(object):
> >     x = 6
> >     def spam(self):
> >       return x
> >   return eggs
> >
> > spam()().spam() should return 5.
> >
>
> the question that arises is -- is this what we wanted?
> if i had to read such code, where i can't (easily) tell where "x"
> is bound to, i wouldn't be content, to say the least.

It's obfuscated code. But there is no doubt that these are the
semantics that we wanted, and still want.


-- 
--Guido van Rossum (home page: http://www.python.org/~guido/)
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4