int literals and __class__ (WAS: Is a list an instance of a class?)
Erik Max Francis
max at alcyone.com
Tue Nov 16 02:04:58 EST 2004
Steven Bethard wrote:
> Why does this work? Or, perhaps my real question is why *doesn't* it work
> without the space? Pointers to the appropriate point in the docs would be
> fine... I assume it's something about making parsing easier...?
It's because otherwise it's confusing it for a floating point literal.
All you need to do is put a break so that the parser can't get confused.
1 ._class__ or (1).__class__ will work just fine.
--
Erik Max Francis && max at alcyone.com && http://www.alcyone.com/max/
San Jose, CA, USA && 37 20 N 121 53 W && AIM erikmaxfrancis
Love is the triumph of imagination over intelligence.
-- H.L. Mencken
More information about the Python-list
mailing list