Inconsistency in Python?
pyth at devel.trillke.net
Thu Aug 29 10:15:45 CEST 2002
> I just played with the built-in function getattr() to find some
> interesting things arround, and I found something strange.
> Look these code:
> >>> ''.__len__()
> >>> s=''
> >>> s.__len__()
> while comes up with an int object:
> >>> 2.__abs__()
> SyntaxError: invalid syntax
it is parsed as a *wrong* floating point number. Try
>>> 2 .__abs__()
More information about the Python-list