Why not 3.__class__ ?

Emile van Sebille emile at fenx.com
Tue Oct 9 11:47:03 EDT 2001


Because tuples have methods now.

Python 2.2a4+ (#56, Oct  4 2001, 12:59:29)
[GCC 2.96 20000731 (Red Hat Linux 7.0)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> dir(())
['__add__', '__class__', '__contains__', '__delattr__', '__eq__', '__ge__',
'__getattribute__', '__getitem__', '__getslice__', '__gt
__', '__hash__', '__init__', '__le__', '__len__', '__lt__', '__mul__',
'__ne__', '__new__', '__reduce__', '__repr__', '__rmul__', '_
_setattr__', '__str__']
>>>

--

Emile van Sebille
emile at fenx.com

---------
"Paul Rubin" <phr-n2001d at nightsong.com> wrote in message
news:7x4rp8q1cy.fsf at ruckus.brouhaha.com...
> Guido van Rossum <guido at python.org> writes:
> > Marcin, I don't understand why you care so much about being able to
> > write 3.foo.  It's painful to fix in the lexer, and probably leads to
> > less useful error messages if someone makes a mistake in a float
> > literal (e.g. "3.e 0").  And I see zero use for it: in practice, you
> > will never ask for 3.foo -- you'll ask for x.foo where x happens to
> > contain the value 3.
>
> How about (3).foo?




More information about the Python-list mailing list