[Tutor] Is implicit underscore assignment documented?
Alan Gauld
alan.gauld at freenet.co.uk
Sat Jul 8 14:03:36 CEST 2006
>> Is this documented anywhere?
The language reference has this to say:
2.3.2 Reserved classes of identifiers
Certain classes of identifiers (besides keywords) have special
meanings.
These classes are identified by the patterns of leading and trailing
underscore characters:
_* Not imported by "from module import *". The special identifier
"_"
is used in the interactive interpreter to store the result of the
last evaluation;
it is stored in the __builtin__ module. When not in interactive
mode, "_"
has no special meaning and is not defined.
HTH,
Alan Gauld
Author of the Learn to Program web site
http://www.freenetpages.co.uk/hp/alan.gauld
More information about the Tutor
mailing list