Thomas Jollans wrote:
What if set has side effects? A
compiler could only exclude this possibility if it knew exactly what set
will be at run time,
And also that 'a' remains bound to the same object, and that
object or anything reachable from it is not mutated in
any way that could affect the
John Nagle na...@animats.com wrote:
I was talking to the Facebook guys doing the compiler for PHP, and they
said that it was a huge win for them that PHP doesn't allow dynamically
replacing a function.
I'm not sure if I call all that effort for a 50% speed increase a win.
PyPy is seeing speed
On 8/18/2010 3:12 PM, Thomas Jollans wrote:
On Wednesday 18 August 2010, it occurred to John Nagle to exclaim:
On 8/18/2010 11:24 AM, ernest wrote:
Hi,
In this code:
if set(a).union(b) == set(a): pass
Does Python compute set(a) twice?
CPython does. Shed Skin might optimize. Don't
On Thu, 2010-08-19 at 00:12 +0200, Thomas Jollans wrote:
On Wednesday 18 August 2010, it occurred to John Nagle to exclaim:
On 8/18/2010 11:24 AM, ernest wrote:
Hi,
In this code:
if set(a).union(b) == set(a): pass
Does Python compute set(a) twice?
CPython does.
On 19 Ago, 08:40, Frederic Rentsch anthra.nor...@bluewin.ch wrote:
On Thu, 2010-08-19 at 00:12 +0200, Thomas Jollans wrote:
On Wednesday 18 August 2010, it occurred to John Nagle to exclaim:
On 8/18/2010 11:24 AM, ernest wrote:
Hi,
In this code:
if set(a).union(b) == set(a):
Hi,
In this code:
if set(a).union(b) == set(a): pass
Does Python compute set(a) twice?
Thanks in advance.
Ernest
--
http://mail.python.org/mailman/listinfo/python-list
ernest wrote:
In this code:
if set(a).union(b) == set(a): pass
Does Python compute set(a) twice?
a = abc
b = def
_set = set
def set(x):
... print computing set(%r) % x
... return _set(x)
...
if set(a).union(b) == set(a): pass
...
computing set('abc')
computing set('abc')
So
On 8/18/2010 11:24 AM, ernest wrote:
Hi,
In this code:
if set(a).union(b) == set(a): pass
Does Python compute set(a) twice?
CPython does. Shed Skin might optimize. Don't know
about Iron Python.
John Nagle
--
On Wednesday 18 August 2010, it occurred to John Nagle to exclaim:
On 8/18/2010 11:24 AM, ernest wrote:
Hi,
In this code:
if set(a).union(b) == set(a): pass
Does Python compute set(a) twice?
CPython does. Shed Skin might optimize. Don't know
about Iron Python.
I doubt
On Thu, Aug 19, 2010 at 9:12 AM, Thomas Jollans tho...@jollybox.de wrote:
I doubt any actual Python implementation optimizes this -- how could it?
The
object set is clearly being called twice, and it happens to be called
with
the object a as a sole argument twice. What if set has side
10 matches
Mail list logo