Re: scope, modyfing outside object from inside the method

2007-09-26 Thread Gabriel Genellina
En Wed, 26 Sep 2007 10:39:22 -0300, Marcin Stępnicki <[EMAIL PROTECTED]> escribi�: > At first glance (before adding id()) it's a little bit weird. The > original > object was supposedly "overwritten", but as one can see it has different > id then the new one. mystruct still holds references to

Re: scope, modyfing outside object from inside the method

2007-09-26 Thread Marcin Stępnicki
Dnia Mon, 24 Sep 2007 10:41:22 -0300, Ricardo Aráoz napisał(a): > Would this work for you? Thank you both for help. Well - yes and no :). It's getting more interesting: First, your code: class myrow(): def __init__(self, idict = {}): self.container = idict def __str__ (self):

Re: scope, modyfing outside object from inside the method

2007-09-24 Thread Ricardo Aráoz
Marcin Stępnicki wrote: > Hello. > > I thought I understand this, but apparently I don't :(. I'm missing > something very basic and fundamental here, so redirecting me to the > related documentation is welcomed as well as providing working code :). > > Trivial example which works as expected: >

Re: scope, modyfing outside object from inside the method

2007-09-24 Thread Dustan
On Sep 24, 2:13 am, Peter Otten <[EMAIL PROTECTED]> wrote: > @property > def value(self): > return self._resultset[self._row][self._col] I remember a thread where someone created a version of property that worked like this, but it's not in the standard python release, unless it is

Re: scope, modyfing outside object from inside the method

2007-09-24 Thread Peter Otten
Marcin Stępnicki wrote: > Hello. > > I thought I understand this, but apparently I don't :(. I'm missing > something very basic and fundamental here, so redirecting me to the > related documentation is welcomed as well as providing working code :). > > Trivial example which works as expected: >

scope, modyfing outside object from inside the method

2007-09-23 Thread Marcin Stępnicki
Hello. I thought I understand this, but apparently I don't :(. I'm missing something very basic and fundamental here, so redirecting me to the related documentation is welcomed as well as providing working code :). Trivial example which works as expected: >>> x = {'a':123, 'b': 456} >>> y = x >