Why not 3.__class__ ?

John Roth johnroth at ameritech.net
Wed Oct 10 17:42:32 CEST 2001

"Michael Abbott" <michael at rcp.co.uk> wrote in message
news:Xns9135B158B74CBmichaelrcpcouk at
> Paul Rubin <phr-n2001d at nightsong.com> wrote in
> news:7x4rp8q1cy.fsf at ruckus.brouhaha.com:
> > How about (3).foo?
> I should have tried it before posting.  This (and 3 .foo) already works in
> Python 2.1 (complains "'int' object has no attribute 'foo'", of course),
> I would have thought the entire discussion was pointless: nothing needs to
> be changed to get the desired behaviour!

That's not exactly true. Making a feature dependent on whether there is
white space between components violates the principle of least astonishment.
It's also a very fertile source for very obscure bugs.

John Roth

More information about the Python-list mailing list