[pypy-dev] funny observation with range
Christian Tismer
tismer at stackless.com
Mon Sep 12 03:29:19 CEST 2005
Hi Armin,
when I added a few tests for the new variable step variant,
I observed the following behavior of ranges:
When a variable is conditionally assigned two different ranges,
the ranges are kept, unless the steps are different.
Well, after all this is not too surprizing, since we are compiling
the step constant in.
But I thing the action taken is not so pleasant:
The range is turned into a list in this case!
I guess what we want is either special-casing the respective blocks,
or at least map this to the variable step case, if this is possible.
I would like to understand why the annotator thinks this must
become a list, and how I can convince it to take a different action.
I think, using the variable variant would be adequate in this case.
A test_range_funny was added to test_rrange.py, not really
meant as a test, but to explain that.
Please let me know what you think.
cheers - chris
--
Christian Tismer :^) <mailto:tismer at stackless.com>
tismerysoft GmbH : Have a break! Take a ride on Python's
Johannes-Niemeyer-Weg 9A : *Starship* http://starship.python.net/
14109 Berlin : PGP key -> http://wwwkeys.pgp.net/
work +49 30 802 86 56 mobile +49 173 24 18 776 fax +49 30 80 90 57 05
PGP 0x57F3BF04 9064 F4E1 D754 C2FF 1619 305B C09C 5A3B 57F3 BF04
whom do you want to sponsor today? http://www.stackless.com/
More information about the pypy-dev
mailing list