[Python-Dev] Is implicit underscore assignment buggy?

Fredrik Lundh fredrik at pythonware.com
Thu Jun 8 00:04:27 CEST 2006


Raymond Hettinger wrote:

> When the result of an expression is None, the interactive interpreter 
> correctly suppresses the display of the result.  However, it also 
>  suppresses the underscore assignment.  I'm not sure if that is correct 
>  or desirable because a subsequent statement has no way of knowing 
>  whether the underscore assignment is current or whether it represents an 
>  earlier non-None result.

why would a subsequent statement need to know that ?  are you sure you 
didn't mean "user" instead of "subsequent statement" ?

for users, it's actually quite simple to figure out what's in the _ 
variable: it's the most recently *printed* result.  if you cannot see 
it, it's not in there.

</F>



More information about the Python-Dev mailing list