Comment on draft PEP for deprecating six builtins

Roman Neuhauser neuhauser at mail.cz
Tue Apr 30 04:54:44 EDT 2002


> From: Alex Martelli <aleax at aleax.it>
> Subject: Re: Comment on draft PEP for deprecating six builtins
> To: python-list at python.org
> Date: Mon, 29 Apr 2002 15:59:16 GMT
> 
> Roman Neuhauser wrote:
> 
> >> The problem with int.chr() is that a lot of people are going to get
> >> confused when they find that "42.chr()" doesn't work (although "42
> >> .chr()" does).
> > 
> >     why? letters aren't valid decimal digits, are they?
> 
> Decimal digits have nothing to do with it.  The lexer does maximal-munch,
> so it snags off "42." as one first valid token (a float), "chr" as a
> second one, and so on -- unless you separate the digits from the dot,
> e.g. with whitespace, this is more or less inevitable.  And making the
> lexer complicated/slower/less predictable to allow "calling methods on
> integer literals" without space doesn't appear an attractive trade-off.

    Right, I didn't realize 42. was a valid float. The space would be a
    reasonable (beit tedious) solution. As long as this is highlighted
    in the docs, I don't see a problem.

-- 
FreeBSD 4.4-STABLE
10:47AM up 1 day, 1:13, 11 users, load averages: 0.02, 0.01, 0.00





More information about the Python-list mailing list