Filtering out non-readable characters
Robert Kern
rkern at ucsd.edu
Tue Jul 19 00:51:16 EDT 2005
Michael Ströder wrote:
> Peter Hansen wrote:
>
>>>>>''.join(chr(c) for c in range(65, 91))
>>
>>'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
>
> Wouldn't this be a candidate for making the Python language stricter?
>
> Do you remember old Python versions treating l.append(n1,n2) the same
> way like l.append((n1,n2)). I'm glad this is forbidden now.
That wasn't a syntax issue; it was an API issue. list.append() allowed
multiple arguments and interpreted them as if they were a single tuple.
That was confusing and unnecessary.
Allowing generator expressions to forgo extra parentheses where they
aren't required is something different, and in my opinion, a good thing.
--
Robert Kern
rkern at ucsd.edu
"In the fields of hell where the grass grows high
Are the graves of dreams allowed to die."
-- Richard Harter
More information about the Python-list
mailing list