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/2000-April/003543.html below:

Arbitrary attributes on funcs and methods)

[Python-Dev] Object customization (was: Arbitrary attributes on funcs and methods) [Python-Dev] Object customization (was: Arbitrary attributes on funcs and methods)Moshe Zadka Moshe Zadka <mzadka@geocities.com>
Fri, 14 Apr 2000 19:46:12 +0200 (IST)
On Thu, 13 Apr 2000, Vladimir Marangozov wrote:

> >>> def this():
> ...     sucks = "no"
> ...
> >>> this.sucks = "yes"
> >>>
> >>> print this.sucks
> 'yes'
> 
> Why on earth 'sucks' is not the object defined in the function's namespace?
> Who made that deliberate decision? Clearly 'this' defines a new namespace,
> so it'll be also legitimate to get a NameError, or to:
> 
> >>> print this.sucks
> 'no'
> 
> Don't you think?

No.

>>> def this(turing_machine):
...	if stops(turing_machine):
...		confusing = "yes"
...	else:
...		confusing = "no"
...
>>> print this.confusing
<Python kills itself out of mercy>

--
Moshe Zadka <mzadka@geocities.com>. 
http://www.oreilly.com/news/prescod_0300.html
http://www.linux.org.il -- we put the penguin in .com




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