On 2007-12-06, samwyse <[EMAIL PROTECTED]> wrote:
> On Dec 6, 1:12 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote:
> And that's my complaint. The value in is being replaced by
> something almost, but not quite, identical to the original value.
> Python's internal implementation of __iadd__ for
On Dec 7, 12:45 am, "Gabriel Genellina" <[EMAIL PROTECTED]>
wrote:
> En Fri, 07 Dec 2007 03:01:28 -0300, MonkeeSage <[EMAIL PROTECTED]>
> escribió:
>
> > I've wondered about this myself. Seems to me, to prevent clobbering
> > subclasses, __iadd__ (and all of the integer and float and whatever)
> >
En Fri, 07 Dec 2007 03:01:28 -0300, MonkeeSage <[EMAIL PROTECTED]>
escribió:
> I've wondered about this myself. Seems to me, to prevent clobbering
> subclasses, __iadd__ (and all of the integer and float and whatever)
> methods that return new instances, should work like this (obviously I
> mean
On Dec 6, 3:02 pm, samwyse <[EMAIL PROTECTED]> wrote:
> On Dec 6, 1:12 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote:
>
>
>
> > samwyse schrieb:
>
> > > For whatever reason, I need an inproved integer. Sounds easy, let's
> > > just subclass int:
>
> > class test(int):
> > >pass
>
> > >
On 2007-12-06, samwyse <[EMAIL PROTECTED]> wrote:
> And that's my complaint. The value in is being replaced
> by something almost, but not quite, identical to the original
> value. Python's internal implementation of __iadd__ for
> isn't returning , it's returning a new value belonging to
> the
On Dec 6, 2007 3:02 PM, samwyse <[EMAIL PROTECTED]> wrote:
>
> On Dec 6, 1:12 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote:
> > samwyse schrieb:
> >
> > > For whatever reason, I need an inproved integer. Sounds easy, let's
> > > just subclass int:
> >
> > class test(int):
> > >pass
>
On Dec 6, 1:12 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote:
> samwyse schrieb:
>
> > For whatever reason, I need an inproved integer. Sounds easy, let's
> > just subclass int:
>
> class test(int):
> >pass
>
> > Now let's test it:
>
> zed=test(0)
> zed.__class__
> >
>
samwyse schrieb:
> For whatever reason, I need an inproved integer. Sounds easy, let's
> just subclass int:
>
class test(int):
> pass
>
> Now let's test it:
>
zed=test(0)
zed.__class__
>
zed
> 0
>
> So far, so good. Now let's try incrementing:
>
zed+=1
ze
For whatever reason, I need an inproved integer. Sounds easy, let's
just subclass int:
>>> class test(int):
pass
Now let's test it:
>>> zed=test(0)
>>> zed.__class__
>>> zed
0
So far, so good. Now let's try incrementing:
>>> zed+=1
>>> zed
1
>>> zed.__class__
WTF??!
Is this a bug