Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
sur
on Aug 8, 2011
|
parent
|
context
|
favorite
| on:
Retiring a Great Interview Problem
He is using parentheses instead of square brackets, so the code is actually using a generator expression which will produce each value lazily.
eru
on Aug 8, 2011
[–]
Is mydict.items() also lazy?
kragen
on Aug 8, 2011
|
parent
[–]
In Python 3 yes, in Python 2 no. In Python 2 you'd say mydict.iteritems() if you were concerned about it.
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: