[Python-Dev] Int literals and method calls

Delaney, Timothy C (Timothy) tdelaney at avaya.com
Tue Nov 16 00:04:41 CET 2004


"Martin v. Löwis" wrote:

> If you meant to parse
> 
> 1.__class__
> 
> as "<integer 1>" "." "<identifier __class__>", not as "<float 1.0>"
> "<identifier __class_>"

On a related note ...

All this would just go away if in Python 3.0 (or even earlier ;) floats required something after the decimal point i.e. to get '<float 1.0>' you had to type '1.0' and '1.' by itself was a syntax error.

I've never actually seen the use case for having '1.' parse as '<float 1.0>' although I'm sure there is one.

Tim Delaney


More information about the Python-Dev mailing list