Inconsistency in Python?

Gerhard Häring gerhard.haering at
Thu Aug 29 04:18:46 EDT 2002

"lion" wrote:
>>>> 2.__abs__()
> SyntaxError: invalid syntax

Yep. That's because of the Python tokenizer/parser/compiler - whatever is
the right term in this case. There were discussions about this in the past
here. Try:

>>> 2 .__abs__()

instead (note the blank after "2").

More information about the Python-list mailing list