On Wed, Dec 7, 2011 at 9:11 AM, Terry Reedy wrote:
> Cute. I am used to linked lists being built from the bottem up in functional
> languages with immutable nodes. I might even use something like this. Of
> course, for a list of any length, walk needs to be iterative.
>
> def walk(self):
>
On 12/6/2011 7:33 AM, Chris Angelico wrote:
On Tue, Dec 6, 2011 at 11:20 PM, Terry Reedy wrote:
You found an unsafe overlap.
x.thing = x = 1
would work, though it seems strange (and unlikely in practice) to rebind x
to an int after it is bound to a class k instance.
This code is starting to l
On Tue, Dec 6, 2011 at 11:20 PM, Terry Reedy wrote:
> You found an unsafe overlap.
> x.thing = x = 1
> would work, though it seems strange (and unlikely in practice) to rebind x
> to an int after it is bound to a class k instance.
This code is starting to look like it wants to work with a linked
On 12/6/2011 6:06 AM, Yingjie Lan wrote:
Hi, I just figured out this with Python3.2 IDLE:
class k: pass
x=k()
x.thing = 1
x.thing
1
x = x.thing = 1
Traceback (most recent call last):
File "", line 1, in
x = x.thing = 1
AttributeError: 'int' object has no attribute 'thing'
x
1
=
Hi, I just figured out this with Python3.2 IDLE:
>>> class k: pass
>>> x=k()
>>> x.thing = 1
>>> x.thing
1
>>> x = x.thing = 1
Traceback (most recent call last):
File "", line 1, in
x = x.thing = 1
AttributeError: 'int' object has no attribute 'thing'
>>> x
1
>>>
when I do