[rewriting waht I wrote into the issue tracker, which for some
 reason didn't get it -- broken? ]

Hi friends,

it happened that I was sitting here with Raymond Hettinger,
and we played a bit with a code example that Gromit posted on
the PyPy IRC channel the other day.

The examples were

(1)   map(apply, [lambda: t for t in range(10)])
(2)   map(apply, (lambda: t for t in range(10)))

The expected results are [9]*10 for (1). We were not so
sure what (2) should give, so I felt inclined to say the
unfortunate words of

"""Hey, let's see what the upcoming reference-implementation-to-be
says about this""".

I should not have done that. In fact, I blushed heavily and would
better have sunken into the earth, one mile deep.
Well, due to the fact that we pass almost all regression tests,
Raymond admitted that CPython probably still lacks some more
tests, otherwise these would have benn fixed already.

Here the screen log of the blamage:

D:\pypy\dist\pypy\module\stackless\test>\pypy\dist\pypy\bin\py.py
Loading grammar D:\pypy\dist\pypy\interpreter\pyparser\data\Grammar2.5a
faking <type 'module'>
faking <type 'file'>
fake-wrapping interp file <open file '<stdout>', mode 'w' at 0x0096E068>
fake-wrapping interp file <open file '<stderr>', mode 'w' at 0x0096E0B0>
fake-wrapping interp file <open file '<stdin>', mode 'r' at 0x0096E020>
PyPy 0.8.0 in StdObjSpace on top of Python 2.4.2 (startuptime: 20.72 secs)
>>>> map(apply, [lambda: t for t in range(10)])
Traceback (application-level):
  File "<inline>", line 1 in <interactive>
    map(apply, [lambda: t for t in range(10)])
TypeError: apply() takes at least 2 arguments (1 given)
>>>> map(apply, [lambda: t for t in range(10)], [[]]*10)
[9, 9, 9, 9, 9, 9, 9, 9, 9, 9]
>>>> map(apply, (lambda: t for t in range(10)), [[]]*10)
[9, 9, 9, 9, 9, 9, 9, 9, 9, 9]
>>>>

Looks like a double fault, right?

will be more careful before burning fingers and taking my mouth
too full next time.

*blush*ingly y'rs -- chris

--
Christian Tismer             :^)   <mailto:[EMAIL PROTECTED]>
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/
_______________________________________________
[email protected]
http://codespeak.net/mailman/listinfo/pypy-dev

Reply via email to