A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2004-November/049916.html below:

[Python-Dev] Int literals and method calls

[Python-Dev] Int literals and method calls [Python-Dev] Int literals and method callsKay Schluehr kayschluehr at gmx.de
Sun Nov 14 19:27:30 CET 2004
Hi  ,
i wondered why string and bool literals have access methods and one can 
call simply

 >>> "1".__class__
<type 'str'>

 >>> False.__class__
<type 'bool'>

But this won't be true for int literals and float literals except for 
those float literals that are
terminated by a dot:

 >>> 1..__class__
<type 'float'>

The expression below raises an error:

 >>> 1.__class__
Traceback (  File "<interactive input>", line 1
    1.__class__
              ^
SyntaxError: invalid syntax

So it seems to be a parser-problem, related to the ambiguity of the 
terminating dot?
Could this be patched?

Thanks
           Kay



More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4