A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/2003-September/038117.html below:

[Python-Dev] pending deprecation warning for Set.update

[Python-Dev] pending deprecation warning for Set.updateNeil Schemenauer nas-python at python.ca
Wed Sep 17 12:44:35 EDT 2003
On Wed, Sep 17, 2003 at 12:02:00PM -0400, Raymond Hettinger wrote:
> The verbosity issue weighs less because there is the __ior__ operator
> alternative:   a |= b.   That is succinct as you can get.

>>> from sets import Set
>>> s = Set()
>>> s |= [1, 2, 3]
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "/www/plat/python2.3/lib/python2.3/sets.py", line 420, in __ior__
    self._binary_sanity_check(other)
  File "/www/plat/python2.3/lib/python2.3/sets.py", line 313, in _binary_sanity_check
    raise TypeError, "Binary operation only permitted between sets"
TypeError: Binary operation only permitted between sets
>>> s.update([1, 2, 3])
>>> s
Set([1, 2, 3])
>>> 

I quite a few instances of update() that will have to be changed to
union_update().

  Neil

More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4