Vito De Tullio wrote:
> 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)
>>
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 & se
Arnaud Delobelle wrote:
> Dear Pythoneers,
>
> I've got a seemingly simple problem, but for which I cannot find a
> simple solution.
>
> I have a set of objects (say S) containing an object which is equal to
> a given object (say x). So
>
> x in S
>
> is true. So there is an object y in S
On 2013-01-26 00:26, Ian Kelly wrote:
On Fri, Jan 25, 2013 at 4:45 PM, MRAB wrote:
You could first limit the search to only those which it could be:
S & set([y])
A search would be:
f = [m for m in S & set([y]) if m is y][0]
f is y
True
But in practice he won't have y, only x. So tha
On Fri, Jan 25, 2013 at 4:45 PM, MRAB wrote:
> You could first limit the search to only those which it could be:
>
> S & set([y])
>
> A search would be:
>
f = [m for m in S & set([y]) if m is y][0]
f is y
> True
But in practice he won't have y, only x. So that would have to be:
>>
On 01/25/2013 06:14 PM, Arnaud Delobelle wrote:
Dear Pythoneers,
I've got a seemingly simple problem, but for which I cannot find a
simple solution.
I have a set of objects (say S) containing an object which is equal to
a given object (say x). So
x in S
is true. So there is an object y
On 01/25/2013 03:14 PM, Arnaud Delobelle wrote:
I've got a seemingly simple problem, but for which I cannot find a
simple solution.
I have a set of objects (say S) containing an object which is equal to
a given object (say x). So
x in S
is true. So there is an object y in S which is equa
On 2013-01-25 23:14, Arnaud Delobelle wrote:
Dear Pythoneers,
I've got a seemingly simple problem, but for which I cannot find a
simple solution.
I have a set of objects (say S) containing an object which is equal to
a given object (say x). So
x in S
is true. So there is an object y in
On Fri, Jan 25, 2013 at 4:30 PM, Ian Kelly wrote:
> On Fri, Jan 25, 2013 at 4:14 PM, Arnaud Delobelle wrote:
>> Dear Pythoneers,
>>
>> I've got a seemingly simple problem, but for which I cannot find a
>> simple solution.
>>
>> I have a set of objects (say S) containing an object which is equal t
On Fri, Jan 25, 2013 at 4:14 PM, Arnaud Delobelle wrote:
> Dear Pythoneers,
>
> I've got a seemingly simple problem, but for which I cannot find a
> simple solution.
>
> I have a set of objects (say S) containing an object which is equal to
> a given object (say x). So
>
> x in S
>
> is true.
Dear Pythoneers,
I've got a seemingly simple problem, but for which I cannot find a
simple solution.
I have a set of objects (say S) containing an object which is equal to
a given object (say x). So
x in S
is true. So there is an object y in S which is equal to x. My
problem is how to ret
11 matches
Mail list logo