Hi,
A friend of mine stumbled upon the following behavior:
---cut---
>>> class A(object): pass
...
>>> class B(object):
... def __add__(self, other):
... print 'B: adding B and %s objects.' % other.__class__.__name__
...
>>> class C(object):
... def __radd__(self, other):
...
Thanks!
On Fri, Mar 19, 2010 at 16:05, Michael Foord wrote:
> On 19/03/2010 12:46, Alex A. Naanou wrote:
>>
>> [snip...]
>>>>>
>>>>> class C(object):
>>>>>
>>
>> ... def __radd__(self, other):
>&
Hi!
here is a simple piece of code
---cut---
class Dict(dict):
def __init__(self, dct={}):
self._dict = dct
def __getitem__(self, name):
return self._dct[name]
def __setitem__(self, name, value):
self._dct[name] = value
def __delitem__(self, name):
Hi everyone,
Just stumbled on a fun little thing:
We create a simple structure...
l = ([],)
Now modify the list, and...
l[0] += [1]
...we fail:
## Traceback (most recent call last):
## File "F:\work\ImageGrid\cur\ImageGrid\src\test\python-bug.py",
line 17, in
## l[0] += [1]
## Ty
I knew this was a feature!!!
features such as these should be fixed! %)
On Sat, Mar 3, 2012 at 03:38, R. David Murray wrote:
> On Sat, 03 Mar 2012 03:06:33 +0400, "Alex A. Naanou"
> wrote:
>> Hi everyone,
>>
>> Just stumbled on a fun little thing: