This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: backreferences in comprehensions
Type: enhancement Stage:
Components: Interpreter Core Versions: Python 3.3
process
Status: closed Resolution: rejected
Dependencies: Superseder:
Assigned To: Nosy List: mark.dickinson, yoch.melka
Priority: normal Keywords:

Created on 2011-10-05 23:31 by yoch.melka, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Messages (4)
msg144976 - (view) Author: yoch (yoch.melka) Date: 2011-10-05 23:31
Hi,

I would like to use backreferences in list comprehensions (or other comprehensions), such as :

[[elt for elt in lst if elt] for lst in matrix if \{1}]
# \{1} is back reference to [elt for elt in lst if elt] 
# to filter the result of the first comprehension

It would be possible to do this ?

Thanks
msg145061 - (view) Author: Mark Dickinson (mark.dickinson) * (Python committer) Date: 2011-10-07 08:12
Hi,

You're proposing a change to the core language and syntax;  the bug-tracker's not really appropriate for this---it's better suited for small, focused changes (preferably with patches!).  I suggest that you start a thread on the python-ideas mailing list for wider discussion and consideration of possible alternative solutions to the problem you're trying to solve.  It's likely that a PEP and a working implementation would also be required to push this through.

I'm going to close this for now;  it can be reopened if the python-ideas discussion is positive.
msg145062 - (view) Author: Mark Dickinson (mark.dickinson) * (Python committer) Date: 2011-10-07 08:17
I meant to include a link to the mailing list:

http://mail.python.org/mailman/listinfo/python-ideas
msg145179 - (view) Author: yoch (yoch.melka) Date: 2011-10-08 17:50
Okay, thanks ;)
History
Date User Action Args
2022-04-11 14:57:22adminsetgithub: 57321
2011-10-08 17:50:07yoch.melkasetmessages: + msg145179
2011-10-07 08:17:51mark.dickinsonsetmessages: + msg145062
2011-10-07 08:12:46mark.dickinsonsetstatus: open -> closed

components: + Interpreter Core
versions: + Python 3.3
nosy: + mark.dickinson

messages: + msg145061
resolution: rejected
2011-10-05 23:31:33yoch.melkacreate