On 5/2/2010 8:11 AM, dmitrey wrote:
Python 2.6.5 r265:79063
set().update(set()) is None
True
while I expect result of update to be set.
Also, result of
set().add(None)
is None while I expect it to be set with element None (or, maybe, it
should be empty set?)
'Expect' has two different meaning
On Sun, 02 May 2010 05:11:40 -0700, dmitrey wrote:
> Python 2.6.5 r265:79063
set().update(set()) is None
> True
> while I expect result of update to be set.
Change your expectations. Generally, methods which modify the object
rather than creating a new one return None.
>>> s = set([1,2,3])
In article <0bd314a8-db65-43f1-a999-521e2ed71...@n15g2000yqf.googlegroups.com>,
dmitrey wrote:
>
>Python 2.6.5 r265:79063
set().update(set()) is None
>True
>while I expect result of update to be set.
>Also, result of
>set().add(None)
>is None while I expect it to be set with element None (or,
Python 2.6.5 r265:79063
>>>set().update(set()) is None
True
while I expect result of update to be set.
Also, result of
set().add(None)
is None while I expect it to be set with element None (or, maybe, it
should be empty set?)
Regards, D.
--
http://mail.python.org/mailman/listinfo/python-list