Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #37715 > unrolled thread
| Started by | Vito De Tullio <vito.detullio@gmail.com> |
|---|---|
| First post | 2013-01-26 08:55 +0100 |
| Last post | 2013-01-26 08:55 +0100 |
| Articles | 1 — 1 participant |
Back to article view | Back to comp.lang.python
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: Retrieving an object from a set Vito De Tullio <vito.detullio@gmail.com> - 2013-01-26 08:55 +0100
| From | Vito De Tullio <vito.detullio@gmail.com> |
|---|---|
| Date | 2013-01-26 08:55 +0100 |
| Subject | Re: Retrieving an object from a set |
| Message-ID | <mailman.1069.1359186965.2939.python-list@python.org> |
MRAB wrote:
> It turns out that both S & {x} and {x} & S return {x}, not {y}.
curious.
$ python
Python 2.7.3 (default, Jul 3 2012, 19:58:39)
[GCC 4.7.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> x = (1,2,3)
>>> y = (1,2,3)
>>> s = set([y])
>>> (s & set([x])).pop() is y
False
>>> (set([x]) & s).pop() is y
True
maybe it's implementation-defined?
--
ZeD
Back to top | Article view | comp.lang.python
csiph-web