[issue12782] Multiple context expressions do not support parentheses for continuation across lines

2022-01-16 Thread Éric Araujo
Éric Araujo added the comment: [There are two separate events in the ticket log: I added my comment, then noticed I was the only nosy so I found all the prople recently removed by error and re-added them] -- ___ Python tracker

[issue12782] Multiple context expressions do not support parentheses for continuation across lines

2022-01-16 Thread Guido van Rossum
Guido van Rossum added the comment: [Meta: Why did adding a comment add all those people (back?) to the nosy list?] -- ___ Python tracker ___

[issue12782] Multiple context expressions do not support parentheses for continuation across lines

2022-01-16 Thread Éric Araujo
Change by Éric Araujo : -- nosy: +Anthony Sottile, BTaskaya, Jeffrey.Kintscher, Julian, Terry Davis, barry, benjamin.peterson, ezio.melotti, georg.brandl, gvanrossum, ishimoto, jack1142, lukasz.langa, ncoghlan, pablogsal, r.david.murray, serhiy.storchaka, steven.daprano, thautwarm,

[issue12782] Multiple context expressions do not support parentheses for continuation across lines

2022-01-16 Thread Éric Araujo
Éric Araujo added the comment: PEP 8 used with statements as an example of use of backslashes, I am proposing this change: https://github.com/python/peps/pull/2244 -- nosy: +eric.araujo versions: +Python 3.10 -Python 3.8 ___ Python tracker

[issue12782] Multiple context expressions do not support parentheses for continuation across lines

2021-11-04 Thread Eryk Sun
Change by Eryk Sun : -- Removed message: https://bugs.python.org/msg405694 ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue12782] Multiple context expressions do not support parentheses for continuation across lines

2021-11-04 Thread Eryk Sun
Change by Eryk Sun : -- components: +Interpreter Core -IDLE nosy: -ahmedsayeed1982, terry.reedy ___ Python tracker ___ ___

[issue12782] Multiple context expressions do not support parentheses for continuation across lines

2021-11-04 Thread Ahmed Sayeed
Ahmed Sayeed added the comment: $ cat test.c struct foo { int len; https://www.webb-dev.co.uk/category/computers/ int items[]; }; struct foo *p; http://www.compilatori.com/category/technology/ int main() { return 0;

[issue12782] Multiple context expressions do not support parentheses for continuation across lines

2020-06-25 Thread Guido van Rossum
Guido van Rossum added the comment: But it is undocumented and doesn’t work with -X oldparser. -- --Guido (mobile) -- ___ Python tracker ___

[issue12782] Multiple context expressions do not support parentheses for continuation across lines

2020-06-25 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: This is already implemented in master with the new PEG parser so closing this. -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker

[issue12782] Multiple context expressions do not support parentheses for continuation across lines

2020-06-25 Thread thautwarm
thautwarm added the comment: Maybe you should close this. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue12782] Multiple context expressions do not support parentheses for continuation across lines

2020-06-25 Thread thautwarm
thautwarm added the comment: I can confirm Guido's words, now parentheses for continuation across lines are already supported. Even without parentheses, multiline with items can be supported. I just implemented it here:

[issue12782] Multiple context expressions do not support parentheses for continuation across lines

2020-03-09 Thread Guido van Rossum
Guido van Rossum added the comment: If we introduce a PEG-based parser, we can do this without hacking the tokenizer. See https://github.com/gvanrossum/pegen/issues/229 I'd propose to aim for Python 3.10 (if the PEG parser happens). -- nosy: +gvanrossum

[issue12782] Multiple context expressions do not support parentheses for continuation across lines

2020-03-09 Thread Guido van Rossum
Change by Guido van Rossum : -- versions: -Python 3.8 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue12782] Multiple context expressions do not support parentheses for continuation across lines

2020-02-07 Thread jack1142
Change by jack1142 : -- nosy: +jack1142 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue12782] Multiple context expressions do not support parentheses for continuation across lines

2020-01-07 Thread Batuhan
Change by Batuhan : -- nosy: +BTaskaya ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue12782] Multiple context expressions do not support parentheses for continuation across lines

2019-07-03 Thread Jeffrey Kintscher
Change by Jeffrey Kintscher : -- nosy: +Jeffrey.Kintscher ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue12782] Multiple context expressions do not support parentheses for continuation across lines

2019-07-01 Thread Nick Coghlan
Nick Coghlan added the comment: Reviewing the thread, we never actually commented on thautwarm's proposal in https://bugs.python.org/issue12782#msg327875 that aims to strip out any INDENT, NEWLINE, and DEDENT tokens that appear between the opening "with" keyword and the statement header

[issue12782] Multiple context expressions do not support parentheses for continuation across lines

2019-06-20 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: What do you mean with re-raise? The issue is not closed. If you have some proposal to overcome the limitations, the best approach is to comment here in the issue. -- ___ Python tracker

[issue12782] Multiple context expressions do not support parentheses for continuation across lines

2019-06-20 Thread Terry Davis
Terry Davis added the comment: I'd like to re-raise this issue. Should I cross-post to "discuss.python.org - Ideas"? -- nosy: +Terry Davis ___ Python tracker ___

[issue12782] Multiple context expressions do not support parentheses for continuation across lines

2018-10-17 Thread thautwarm
thautwarm added the comment: How about: with_stmt: 'with' (with_items | '(' with_items ')') ':' suite ignored: INDENT | NEWLINE | DEDENT with_items: with_item (ignored* ',' ignored* with_item)* -- nosy: +thautwarm ___ Python tracker

[issue12782] Multiple context expressions do not support parentheses for continuation across lines

2018-10-12 Thread Anthony Sottile
Change by Anthony Sottile : -- nosy: +Anthony Sottile ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue12782] Multiple context expressions do not support parentheses for continuation across lines

2018-09-30 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: Now that I think about this a bit better, this may be actually a problem as: with (yield something) as x: is a more than valid use case that will be broken with the simple grammar rule :( -- ___

[issue12782] Multiple context expressions do not support parentheses for continuation across lines

2018-09-30 Thread Pablo Galindo Salgado
Change by Pablo Galindo Salgado : -- pull_requests: -9036 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue12782] Multiple context expressions do not support parentheses for continuation across lines

2018-09-30 Thread Pablo Galindo Salgado
Change by Pablo Galindo Salgado : -- keywords: +patch pull_requests: +9036 ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue12782] Multiple context expressions do not support parentheses for continuation across lines

2018-09-28 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: The DFA for the rule with_stmt: 'with' ( with_item (',' with_item)* | '(' with_item (',' with_item)* [','] ')' ) ':' suite is: DFA for with_stmt

[issue12782] Multiple context expressions do not support parentheses for continuation across lines

2018-09-28 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: The Python grammar is already not LL(1) strictly. Take for example the production for "argument": argument: ( test [comp_for] | test '=' test | '**' test | '*' test ) obviously the first sets of test and test are the same and is ambiguous, but the

[issue12782] Multiple context expressions do not support parentheses for continuation across lines

2018-09-28 Thread Nick Coghlan
Nick Coghlan added the comment: Especially since the dynamic flexibility of ExitStack comes at a genuine runtime cost when unwinding the resource stack. I also (very!) belatedly noticed that I never answered Julian's request for clarification about the potential grammar ambiguity, so going

[issue12782] Multiple context expressions do not support parentheses for continuation across lines

2018-09-28 Thread Łukasz Langa
Łukasz Langa added the comment: This was closed without enough explanation. Suggesting people should use ExitStack due to a Python grammar deficiency is suboptimal to say the least. This problem is coming back to users of Black due to Black's removal of backslashes. It's the only piece of

[issue12782] Multiple context expressions do not support parentheses for continuation across lines

2018-09-28 Thread Łukasz Langa
Change by Łukasz Langa : -- assignee: -> pablogsal nosy: +pablogsal ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue12782] Multiple context expressions do not support parentheses for continuation across lines

2017-05-14 Thread Ulrich Petri
Ulrich Petri added the comment: So this would basically be: with ExitStack() as stack: cm1 = stack.enter_context(a_long_name.with_a_long_method()) cm2 = stack.enter_context(another_long_variable.with_a_long_method()) Seems like a very non-obvious and inelegant solution...

[issue12782] Multiple context expressions do not support parentheses for continuation across lines

2015-02-16 Thread Barry A. Warsaw
Barry A. Warsaw added the comment: Let's just Won't Fix this. Use a contextlib.ExitStack. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12782 ___

[issue12782] Multiple context expressions do not support parentheses for continuation across lines

2015-02-16 Thread Barry A. Warsaw
Changes by Barry A. Warsaw ba...@python.org: -- resolution: - wont fix status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12782 ___

[issue12782] Multiple context expressions do not support parentheses for continuation across lines

2015-02-15 Thread Steven D'Aprano
Steven D'Aprano added the comment: This has come up on Python-Ideas again: http://permalink.gmane.org/gmane.comp.python.ideas/32002 https://mail.python.org/pipermail/python-ideas/2015-February/032000.html -- nosy: +steven.daprano ___ Python tracker

[issue12782] Multiple context expressions do not support parentheses for continuation across lines

2013-01-24 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: There is a discussion about this on Python-Ideas: http://comments.gmane.org/gmane.comp.python.ideas/17597 http://mail.python.org/pipermail/python-ideas/2012-October/017610.html -- nosy: +serhiy.storchaka ___

[issue12782] Multiple context expressions do not support parentheses for continuation across lines

2013-01-23 Thread Atsuo Ishimoto
Atsuo Ishimoto added the comment: In Python 3.3, we have contextlib.ExitStack() for multiple contexts. So, perhaps we can close this issue? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12782

[issue12782] Multiple context expressions do not support parentheses for continuation across lines

2013-01-23 Thread Ezio Melotti
Ezio Melotti added the comment: If this can't be fixed I think it should be at least documented in the FAQs. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12782 ___

[issue12782] Multiple context expressions do not support parentheses for continuation across lines

2012-10-31 Thread Ezio Melotti
Changes by Ezio Melotti ezio.melo...@gmail.com: -- nosy: +barry versions: +Python 3.4 -Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12782 ___

[issue12782] Multiple context expressions do not support parentheses for continuation across lines

2012-08-09 Thread Atsuo Ishimoto
Changes by Atsuo Ishimoto ishim...@gembook.org: -- nosy: +ishimoto ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12782 ___ ___ Python-bugs-list

[issue12782] Multiple context expressions do not support parentheses for continuation across lines

2011-08-22 Thread Julian Berman
Julian Berman julian+python@grayvines.com added the comment: we explicitly advise against importing too many modules in a single import statement, but importing multiple names from a single location is often a useful thing to do. Cool. I imagined this had to do with it. there may be

[issue12782] Multiple context expressions do not support parentheses for continuation across lines

2011-08-21 Thread R. David Murray
R. David Murray rdmur...@bitdance.com added the comment: Following on to Georg's comment about expressions, as a workaround, note that: with ( open('abc')) as foo: works. -- nosy: +r.david.murray ___ Python tracker rep...@bugs.python.org

[issue12782] Multiple context expressions do not support parentheses for continuation across lines

2011-08-21 Thread Nick Coghlan
Nick Coghlan ncogh...@gmail.com added the comment: As Georg noted, only individual expressions get parentheses based continuations automatically. For statement level use of comma separation, it's decided on a case-by-cases basis as to whether we think it is a legitimate usage based on our

[issue12782] Multiple context expressions do not support parentheses for continuation across lines

2011-08-20 Thread Éric Araujo
Éric Araujo mer...@netwok.org added the comment: I agree it’s unfortunate that we have to use backslashes to have multi-line with statements. -- nosy: +eric.araujo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12782

[issue12782] Multiple context expressions do not support parentheses for continuation across lines

2011-08-20 Thread Georg Brandl
Georg Brandl ge...@python.org added the comment: is the only other example I can think of One similar example would be raise in Python 2. all compound statements uniformly allowed the same continuation syntax. This is not true: only import-as allows this syntax. All other uses of

[issue12782] Multiple context expressions do not support parentheses for continuation across lines

2011-08-20 Thread Ezio Melotti
Changes by Ezio Melotti ezio.melo...@gmail.com: -- nosy: +ezio.melotti ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12782 ___ ___

[issue12782] Multiple context expressions do not support parentheses for continuation across lines

2011-08-19 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: -- nosy: +benjamin.peterson, ncoghlan type: behavior - feature request versions: -Python 2.7 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12782

[issue12782] Multiple context expressions do not support parentheses for continuation across lines

2011-08-18 Thread Julian Berman
New submission from Julian Berman julian+python@grayvines.com: Using multiple `with` statements across multiple lines does not support using parens to break them up: with (open(a_really_long_foo) as foo, open(a_really_long_bar) as bar): pass Traceback (most recent call last):