This post originated from an RSS feed registered with Python Buzz
by Hans Nowak.
Original Post: New generator proposal
Feed Title: Efectos Especiales
Feed URL: http://www.zephyrfalcon.org/weblog2/rss.xml
Feed Description: Ramblings, rants, musings, ideas and observations. Topics include (but are not limited to): programming (especially Python), books, games (especially CCGs and board games), astrology, design, writing, painting, etc.
PEP 289 has seen a revival. It was announced on c.l.py today: In brief, the PEP proposes a list comprehension style syntax for creating fast, memory efficient generator expressions on the fly: sum(x*x for x in roots) min(d.temperature()*9/5 + 32 for d in days) Set(word.lower() for word in text.split() if len(word) dict( (k, somefunc(k)) for k in keylist ) dotproduct = sum(x*y for x,y in itertools.izip(xvec, yvec)) bestplayer, bestscore = max( (p.score, p.name) for p in players ) Each of the above runs without creating a full list in memory, which saves allocation time, conserves resources, and exploits cache locality. ... [418 words]