python gripes survey
Patrick Lioi
patrick at novaroot.com
Sun Aug 24 20:41:35 EDT 2003
I would like to see a shorthand for list.append(), borrowed from PHP:
foo = [1, 2, 3]
foo[] = 4 # foo now equals [1, 2, 3, 4]
I would also like to see what would probably end up being called
"generator comprehensions". That is definitely not my own idea, but
for the life of me I can't remember where I first heard about it.
Imagine being able to throw the yield keyword into a list
comprehension syntax in order to take advantage of list
comprehension's in a memory-efficient way, something kinda like this:
foo = [yield i*i for i in xrange(100)]
More information about the Python-list
mailing list