Flavio a écrit :
Hi, I have been playing with set operations lately and came across a
kind of surprising result given that it is not mentioned in the
standard Python tutorial:
with python sets, intersections and unions are supposed to be done
like this:
In [7]:set('casa') set('porca')
Hi, I have been playing with set operations lately and came across a
kind of surprising result given that it is not mentioned in the
standard Python tutorial:
with python sets, intersections and unions are supposed to be done
like this:
In [7]:set('casa') set('porca')
Out[7]:set(['a', 'c'])
Flavio wrote:
Hi, I have been playing with set operations lately and came across a
kind of surprising result given that it is not mentioned in the
standard Python tutorial:
with python sets, intersections and unions are supposed to be done
like this:
In [7]:set('casa') set('porca')
On Monday 06 August 2007, Flavio wrote:
So My question is: Why has this been implemented in this way? I can
see this confusing many newbies...
I did not implement this, so I cannot say, but it does have useful
side-effects, for example:
x = A or B
is equivalent to:
if A:
x = A
else:
x =
Flavio wrote:
Hi, I have been playing with set operations lately and came across a
kind of surprising result given that it is not mentioned in the
standard Python tutorial:
with python sets, intersections and unions are supposed to be done
like this:
In [7]:set('casa') set('porca')
On Mon, 06 Aug 2007 14:13:51 +, Flavio wrote:
Hi, I have been playing with set operations lately and came across a
kind of surprising result given that it is not mentioned in the standard
Python tutorial:
with python sets, intersections and unions are supposed to be done
like this:
In article [EMAIL PROTECTED],
Diez B. Roggisch [EMAIL PROTECTED] wrote:
Flavio wrote:
Hi, I have been playing with set operations lately and came across a
kind of surprising result given that it is not mentioned in the
standard Python tutorial:
with python sets, intersections
Michael J. Fromberger [EMAIL PROTECTED]
wrote:
...
Also, it is a common behaviour in many programming languages for logical
connectives to both short-circuit and yield their values, so I'd argue
that most programmers are proabably accustomed to it. The and ||
operators of C and its