Message52826
Dict comprehensions, implemented somewhat like:
d = {}
for key, value in gen():
d[key] = value
A version that passes the generator directly to dict() might be faster (although it would have to generate tuples instead of two separate items on the stack, which may negate the benefit of doing the actual dict assignment in C) -- and of course the danger of passing the generator to a local or global 'dict' variable instead of the builtin 'dict'.
Includes tests, but not compiler-package or documentation changes (yet).
|
|
| Date |
User |
Action |
Args |
| 2007-08-23 15:58:59 | admin | link | issue1751800 messages |
| 2007-08-23 15:58:59 | admin | create | |
|