Kay Schluehr wrote: > >>> 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? There is no ambiguity. This expression parses as two tokens, floatnumber (through the second alternative of pointfloat), followed by identifier. While this is not explicitly specified in the language reference, Python follows the common "longest match" approach to tokenization, i.e. you extend each token from the beginning of the input as much as you can, and then proceed to the next token. > Could this be patched? Perhaps. But it should not, as the current behaviour is intentional. If you want to take attributeref of an integer literal, use one of the following forms: >>> 2 .__class__ <type 'int'> >>> (3).__class__ <type 'int'> Regards, Martin
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