[Python-bugs-list] [ python-Bugs-827209 ] List comprehensions leaking control variable name deprecated

SourceForge.net noreply at sourceforge.net
Tue Oct 21 09:52:23 EDT 2003


Bugs item #827209, was opened at 2003-10-20 18:41
Message generated for change (Comment added) made by montanaro
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=827209&group_id=5470

Category: Documentation
Group: Python 2.3
Status: Open
Resolution: None
Priority: 5
Submitted By: Tim Delaney (tcdelaney)
Assigned to: Nobody/Anonymous (nobody)
Summary: List comprehensions leaking control variable name deprecated

Initial Comment:
According to the email thread starting:

http://mail.python.org/pipermail/python-dev/2003-
October/039081.html

the control variable name in a list comprehension should 
not be leaked and any use of such a leaked name is 
deprecated.

----------------------------------------------------------------------

>Comment By: Skip Montanaro (montanaro)
Date: 2003-10-21 08:52

Message:
Logged In: YES 
user_id=44345

A good point raised by Michael Hudson is that

   foo = [x for x in R]
   print x

will fail if R is empty (and x wasn't previously defined).
All the more reason to deprecate its usage and 
suppress the leaking variable.


----------------------------------------------------------------------

Comment By: Terry J. Reedy (tjreedy)
Date: 2003-10-20 19:04

Message:
Logged In: YES 
user_id=593130

Ref Man 5.2.4 List displays:  suggested addition at end.

Using leaked 'for <exp_list>' control variables outside the list 
display is deprecated and will not work when the bug is fixed.


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=827209&group_id=5470



More information about the Python-bugs-list mailing list