Ok, so I took a closer look at the documentation and tried a few things
to understand better what you said and I have some remark ...
Phillip J. Eby a ecrit :
At 06:15 PM 9/28/2005 +0200, Pierre Barbier de Reuille wrote:
Regularly, you see questions about augmented assignment on Python-tutor
On Thu, Sep 29, 2005, Pierre Barbier de Reuille wrote:
Ok, so I took a closer look at the documentation and tried a few things
to understand better what you said and I have some remark ...
I've got some counter-remarks, but python-dev is not the place to
discuss them. Please move this thread
Done :)
I summarized my point of view and I'm waiting for comments :)
Pierre
Aahz a écrit :
On Thu, Sep 29, 2005, Pierre Barbier de Reuille wrote:
Ok, so I took a closer look at the documentation and tried a few things
to understand better what you said and I have some remark ...
I've
Hi,
a general question. Consider:
class A(list):
def __setitem__(self, index, item):
# do something with index and item
return list.__setitem__(self, index, item)
lst = A([1,set()])
lst[0] |= 1
lst[1] |= set([1])
Do we want lst.__setitem__ to be called in the second
On Sep 28, 2005, at 9:12 AM, Reinhold Birkenfeld wrote:
Hi,
a general question. Consider:
class A(list):
def __setitem__(self, index, item):
# do something with index and item
return list.__setitem__(self, index, item)
lst = A([1,set()])
lst[0] |= 1
lst[1] |=
At 03:12 PM 9/28/2005 +0200, Reinhold Birkenfeld wrote:
Hi,
a general question. Consider:
class A(list):
def __setitem__(self, index, item):
# do something with index and item
return list.__setitem__(self, index, item)
lst = A([1,set()])
lst[0] |= 1
lst[1] |= set([1])
Phillip J. Eby a écrit :
At 03:12 PM 9/28/2005 +0200, Reinhold Birkenfeld wrote:
[...]
Yes. See:
http://www.python.org/2.0/new-python.html#SECTION00070
The purpose of the augmented assignment forms is to allow for the
possibility that the item's __i*__ method may or may
At 05:15 PM 9/28/2005 +0200, Reinhold Birkenfeld wrote:
Okay. I assume that we must accept that
s = set()
t = (s,)
t[0] |= set([1])
changes s in spite of raising TypeError.
There are lots of operations that can be partially completed before raising
an error, so I'm not sure why this case would
At 05:40 PM 9/28/2005 +0200, Pierre Barbier de Reuille wrote:
Rather than closing this as invalid, it would be wiser to update the
documentation before ! Nothing corresponds to the current behavior.
I got my information from here:
Phillip J. Eby a écrit :
At 05:40 PM 9/28/2005 +0200, Pierre Barbier de Reuille wrote:
Rather than closing this as invalid, it would be wiser to update the
documentation before ! Nothing corresponds to the current behavior.
I got my information from here:
At 06:15 PM 9/28/2005 +0200, Pierre Barbier de Reuille wrote:
Regularly, you see questions about augmented assignment on Python-tutor
mailing list, I often have question in my lab because of problems ...
most of the time people learn to avoid these operators in the end ! And
my look in the
11 matches
Mail list logo