RE: [Python-Dev] Int literals and method calls
"Martin v. Löwis" wrote:
If you meant to parse
1.__class__
as "
" "." "<identifier __class__>", not as " " "<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 '
Delaney, Timothy C (Timothy) wrote:
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 '
' you had to type '1.0' and '1.' by itself was a syntax error.
I always write float literals that way anyhow, in the interests of clarity. So I wouldn't mind if this happened either. +0 -- Greg Ewing, Computer Science Dept, +--------------------------------------+ University of Canterbury, | A citizen of NewZealandCorp, a | Christchurch, New Zealand | wholly-owned subsidiary of USA Inc. | greg@cosc.canterbury.ac.nz +--------------------------------------+
On Nov 16, 2004, at 4:00 AM, Greg Ewing wrote:
Delaney, Timothy C (Timothy) wrote:
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 '
' you had to type '1.0' and '1.' by itself was a syntax error. I always write float literals that way anyhow, in the interests of clarity. So I wouldn't mind if this happened either.
+0
I tend to use integer float literals without the trailing zero from the interpreter if I want float division to happen without typing "from __future__ import division". Having to type an additional character isn't a problem, though. +0 -bob
participants (3)
-
Bob Ippolito
-
Delaney, Timothy C (Timothy)
-
Greg Ewing