A RetroSearch Logo

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

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/2001-August/017130.html below:

playing with 2.2a1 => strange behaviour, or misunderstanding

[Python-Dev] Q: playing with 2.2a1 => strange behaviour, or misunderstandingGuido van Rossum guido@python.org
Mon, 20 Aug 2001 09:11:15 -0400
> I have tried this with 2.2a1:
> 1. I have not checked the related C code
> 2. I have not checked the bug report list
> 
> >>> class C(object): pass
> ...
> >>> c=C()
> >>> c.a=3
> >>> object.__getattr__(c,'a')
> 3
> >>> object.__setattr__(c,'a',6)
> Traceback (most recent call last):
>   File "<stdin>", line 1, in ?
> TypeError: function takes exactly 2 arguments (3 given)
> 
> Is that meaningful or a problem?
> I'm trying to understand type/class unification to consider possible jython
> issues.
> 
> regards, Samuele Pedroni

This was a 2.2a1 specific problem: in that version, the object class
didn't define a setattr dispatch slot, and object.__setattr__ ended up
returning a *bound* method of the object *class*.

In 2.2a2 this won't be a problem -- the object now defines
__setattr__.

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



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