[Python-ideas] Re: Add a mechanism so that multiple exceptions can be caught using `except E1, E2, E3:`

2021-05-09 Thread Chris Angelico
On Mon, May 10, 2021 at 12:49 PM Guido van Rossum wrote: > > On Sun, May 9, 2021 at 5:08 PM Chris Angelico wrote: >> >> On Mon, May 10, 2021 at 9:57 AM Steven D'Aprano wrote: >> > >> > On Sun, May 09, 2021 at 04:45:55PM -, Thomas Grainger wrote: >> > >> > > now that python2.7 is EOL, it

[Python-ideas] Re: Add a mechanism so that multiple exceptions can be caught using `except E1, E2, E3:`

2021-05-09 Thread Guido van Rossum
On Sun, May 9, 2021 at 5:08 PM Chris Angelico wrote: > On Mon, May 10, 2021 at 9:57 AM Steven D'Aprano > wrote: > > > > On Sun, May 09, 2021 at 04:45:55PM -, Thomas Grainger wrote: > > > > > now that python2.7 is EOL, it might be worth resurrecting this syntax > > [...] > > > except E1, E2,

[Python-ideas] Re: Add a mechanism so that multiple exceptions can be caught using `except E1, E2, E3:`

2021-05-09 Thread Chris Angelico
On Mon, May 10, 2021 at 9:57 AM Steven D'Aprano wrote: > > On Sun, May 09, 2021 at 04:45:55PM -, Thomas Grainger wrote: > > > now that python2.7 is EOL, it might be worth resurrecting this syntax > [...] > > except E1, E2, E3 as e: > > What advantages will this new syntax bring us? > > Will

[Python-ideas] Re: Add a mechanism so that multiple exceptions can be caught using `except E1, E2, E3:`

2021-05-09 Thread Steven D'Aprano
On Sun, May 09, 2021 at 04:45:55PM -, Thomas Grainger wrote: > now that python2.7 is EOL, it might be worth resurrecting this syntax [...] > except E1, E2, E3 as e: What advantages will this new syntax bring us? Will it allow us to do things that we can't currently do? When would you use

[Python-ideas] Re: Add a mechanism so that multiple exceptions can be caught using `except E1, E2, E3:`

2021-05-09 Thread Bruce Leban
On Sun, May 9, 2021 at 1:22 PM MRAB wrote: > > On the third hand(!), 'as' is used in the 'import' and 'with' > statements, where it binds to only one preceding item. > Thanks. Yes, that was what I was thinking that it's weird for "as" to have different precedence in different statements, and I

[Python-ideas] Re: Add a mechanism so that multiple exceptions can be caught using `except E1, E2, E3:`

2021-05-09 Thread MRAB
On 2021-05-09 21:11, Bruce Leban wrote: On Sun, May 9, 2021 at 9:48 AM Thomas Grainger > wrote: now that python2.7 is EOL, it might be worth resurrecting this syntax as discussed in https://www.python.org/dev/peps/pep-3100/#id13

[Python-ideas] Re: Add a mechanism so that multiple exceptions can be caught using `except E1, E2, E3:`

2021-05-09 Thread Bruce Leban
On Sun, May 9, 2021 at 9:48 AM Thomas Grainger wrote: > now that python2.7 is EOL, it might be worth resurrecting this syntax as > discussed in https://www.python.org/dev/peps/pep-3100/#id13 > > eg, python 3.11 could support > ``` > try: > ... > except (E1, E2, E3) as e: > ... > ``` > >

[Python-ideas] Re: Add a mechanism so that multiple exceptions can be caught using `except E1, E2, E3:`

2021-05-09 Thread Shreyan Avigyan
+1 ___ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-le...@python.org https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at

[Python-ideas] Re: Add a mechanism so that multiple exceptions can be caught using `except E1, E2, E3:`

2021-05-09 Thread Paul Bryan
+1 On Sun, 2021-05-09 at 16:45 +, Thomas Grainger wrote: > now that python2.7 is EOL, it might be worth resurrecting this syntax > as discussed in https://www.python.org/dev/peps/pep-3100/#id13 > > eg, python 3.11 could support > ``` > try: >     ... > except (E1, E2, E3) as e: >     ... >

[Python-ideas] Add a mechanism so that multiple exceptions can be caught using `except E1, E2, E3:`

2021-05-09 Thread Thomas Grainger
now that python2.7 is EOL, it might be worth resurrecting this syntax as discussed in https://www.python.org/dev/peps/pep-3100/#id13 eg, python 3.11 could support ``` try: ... except (E1, E2, E3) as e: ... ``` as equivalent to ``` try: ... except E1, E2, E3 as e: ... ``` see