This commit is contained in:
Raymond Hettinger 2003-10-23 17:02:11 +00:00
parent 851181bca6
commit a1471d7250
1 changed files with 1 additions and 1 deletions

View File

@ -41,7 +41,7 @@ expession instead::
Similar benefits are conferred on constructors for container objects:: Similar benefits are conferred on constructors for container objects::
s = Set(word for line in page for word in line.split()) s = Set(word for line in page for word in line.split())
d = dict( (k, func(v)) for k in keylist) d = dict( (k, func(k)) for k in keylist)
Generator expressions are especially useful with functions like sum(), Generator expressions are especially useful with functions like sum(),
min(), and max() that reduce an iterable input to a single value:: min(), and max() that reduce an iterable input to a single value::