A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2006-June/065674.html below:

[Python-Dev] Is implicit underscore assignment buggy?

[Python-Dev] Is implicit underscore assignment buggy? [Python-Dev] Is implicit underscore assignment buggy?Aahz aahz at pythoncraft.com
Thu Jun 8 00:41:22 CEST 2006
On Wed, Jun 07, 2006, Raymond Hettinger wrote:
>Fredrik:
>>
>> 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.
> 
> Of course, there's a pattern to it.  The question is whether it is the
> *right* behavior.  Would the underscore assignment be more useful and
> intuitive if it always contained the immediately preceding result,
> even if it was None?  In some cases (such as the regexp example), None
> is a valid and useful possible result of a computation and you may
> want to access that result with _.

My take is that Fredrik is correct about the current behavior being most
generally useful even if it is slightly less consistent, as well as being
undesired in rare circumstances.  Consider that your message is the only
one I've seen in more than five years of monitoring python-dev and
c.l.py.
-- 
Aahz (aahz at pythoncraft.com)           <*>         http://www.pythoncraft.com/

"I saw `cout' being shifted "Hello world" times to the left and stopped
right there."  --Steve Gonedes
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4