[Python-Dev] Re: a name for the ExceptHandler.type when it is a literal tuple of types

2021-05-10 Thread Thomas Grainger
I opened a new thread here: 
https://mail.python.org/archives/list/python-id...@python.org/thread/WQOMBT4Z22EIFB53WN54E52AYS3QBKAV/
___
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/python-dev@python.org/message/VGXHBXGKOYOKUP6TAEJIZVYBY2QFVPR2/
Code of Conduct: http://python.org/psf/codeofconduct/


[Python-Dev] Re: a name for the ExceptHandler.type when it is a literal tuple of types

2021-05-08 Thread Guido van Rossum
That’s a discussion for another day.

On Sat, May 8, 2021 at 09:17 Thomas Grainger  wrote:

> Would it be possible to drop the requirement that multiple exception types
> are parenthesized? Is it only ambiguous with the old Python2 syntax?
>
> On Sat, 8 May 2021, 20:15 Guido van Rossum,  wrote:
>
>> I propose “exception tuple”, since syntactically and semantically it must
>> be a tuple. (Same as for isinstance() and issubclass().)
>>
>> On Sat, May 8, 2021 at 05:52 Thomas Grainger  wrote:
>>
>>> That's this bit:
>>>
>>> ```
>>> except (A, B):
>>>^^
>>> ```
>>>
>>> bpo-43149 currently calls it an "exception group", but that conflicts
>>> with PEP 654 -- Exception Groups and except*
>>>
>>> ```
>>>
>>>>>> try:
>>>...   pass
>>>... except A, B:
>>>...   pass
>>>Traceback (most recent call last):
>>>SyntaxError: exception group must be parenthesized
>>> ```
>>>
>>> some alternatives:
>>>
>>> exception classinfo must be parenthesized (classinfo so named from the
>>> parameter to issubclass)
>>> exception sequence must be parenthesized
>>>
>>> see also:
>>>
>>> - https://github.com/python/cpython/pull/24467#discussion_r628756347
>>> - https://www.python.org/dev/peps/pep-0654/
>>> ___
>>> Python-Dev mailing list -- python-dev@python.org
>>> To unsubscribe send an email to python-dev-le...@python.org
>>> https://mail.python.org/mailman3/lists/python-dev.python.org/
>>> Message archived at
>>> https://mail.python.org/archives/list/python-dev@python.org/message/HSN6ESRB4BD6IUIPKLMNP4TPBQPWHBFK/
>>> Code of Conduct: http://python.org/psf/codeofconduct/
>>>
>> --
>> --Guido (mobile)
>>
> --
--Guido (mobile)
___
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/python-dev@python.org/message/ZYKTQJDZN3T63ZAUZZ7BLFGYOJVNOSPJ/
Code of Conduct: http://python.org/psf/codeofconduct/


[Python-Dev] Re: a name for the ExceptHandler.type when it is a literal tuple of types

2021-05-08 Thread Thomas Grainger
Would it be possible to drop the requirement that multiple exception types
are parenthesized? Is it only ambiguous with the old Python2 syntax?

On Sat, 8 May 2021, 20:15 Guido van Rossum,  wrote:

> I propose “exception tuple”, since syntactically and semantically it must
> be a tuple. (Same as for isinstance() and issubclass().)
>
> On Sat, May 8, 2021 at 05:52 Thomas Grainger  wrote:
>
>> That's this bit:
>>
>> ```
>> except (A, B):
>>^^
>> ```
>>
>> bpo-43149 currently calls it an "exception group", but that conflicts
>> with PEP 654 -- Exception Groups and except*
>>
>> ```
>>
>>>>> try:
>>...   pass
>>... except A, B:
>>...   pass
>>Traceback (most recent call last):
>>SyntaxError: exception group must be parenthesized
>> ```
>>
>> some alternatives:
>>
>> exception classinfo must be parenthesized (classinfo so named from the
>> parameter to issubclass)
>> exception sequence must be parenthesized
>>
>> see also:
>>
>> - https://github.com/python/cpython/pull/24467#discussion_r628756347
>> - https://www.python.org/dev/peps/pep-0654/
>> ___
>> Python-Dev mailing list -- python-dev@python.org
>> To unsubscribe send an email to python-dev-le...@python.org
>> https://mail.python.org/mailman3/lists/python-dev.python.org/
>> Message archived at
>> https://mail.python.org/archives/list/python-dev@python.org/message/HSN6ESRB4BD6IUIPKLMNP4TPBQPWHBFK/
>> Code of Conduct: http://python.org/psf/codeofconduct/
>>
> --
> --Guido (mobile)
>
___
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/python-dev@python.org/message/3EW75R7I4IYIBKKVPBW333ZBYMPB5YGR/
Code of Conduct: http://python.org/psf/codeofconduct/


[Python-Dev] Re: a name for the ExceptHandler.type when it is a literal tuple of types

2021-05-08 Thread Guido van Rossum
I propose “exception tuple”, since syntactically and semantically it must
be a tuple. (Same as for isinstance() and issubclass().)

On Sat, May 8, 2021 at 05:52 Thomas Grainger  wrote:

> That's this bit:
>
> ```
> except (A, B):
>^^
> ```
>
> bpo-43149 currently calls it an "exception group", but that conflicts with
> PEP 654 -- Exception Groups and except*
>
> ```
>
>>>> try:
>...   pass
>... except A, B:
>...   pass
>Traceback (most recent call last):
>SyntaxError: exception group must be parenthesized
> ```
>
> some alternatives:
>
> exception classinfo must be parenthesized (classinfo so named from the
> parameter to issubclass)
> exception sequence must be parenthesized
>
> see also:
>
> - https://github.com/python/cpython/pull/24467#discussion_r628756347
> - https://www.python.org/dev/peps/pep-0654/
> ___
> Python-Dev mailing list -- python-dev@python.org
> To unsubscribe send an email to python-dev-le...@python.org
> https://mail.python.org/mailman3/lists/python-dev.python.org/
> Message archived at
> https://mail.python.org/archives/list/python-dev@python.org/message/HSN6ESRB4BD6IUIPKLMNP4TPBQPWHBFK/
> Code of Conduct: http://python.org/psf/codeofconduct/
>
-- 
--Guido (mobile)
___
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/python-dev@python.org/message/62WTPW24K3XNOYJNTBC6DWBGZHHKF2L5/
Code of Conduct: http://python.org/psf/codeofconduct/


[Python-Dev] Re: a name for the ExceptHandler.type when it is a literal tuple of types

2021-05-08 Thread Thomas Grainger
There's a PR to use "SyntaxError: multiple exception types must be
parenthesized"

https://github.com/python/cpython/pull/25996

On Sat, 8 May 2021, 19:20 Gregory P. Smith,  wrote:

>
>
> On Sat, May 8, 2021 at 8:54 AM Thomas Grainger  wrote:
>
>> That's this bit:
>>
>> ```
>> except (A, B):
>>^^
>> ```
>>
>> bpo-43149 currently calls it an "exception group", but that conflicts
>> with PEP 654 -- Exception Groups and except*
>>
>> ```
>>
>>>>> try:
>>...   pass
>>... except A, B:
>>...   pass
>>Traceback (most recent call last):
>>SyntaxError: exception group must be parenthesized
>> ```
>>
>> some alternatives:
>>
>> exception classinfo must be parenthesized (classinfo so named from the
>> parameter to issubclass)
>> exception sequence must be parenthesized
>>
>> see also:
>>
>> - https://github.com/python/cpython/pull/24467#discussion_r628756347
>> - https://www.python.org/dev/peps/pep-0654/
>
>
> Given it requires ()s it is probably better to call it an "exception
> sequence" or even go fully to "exception tuple" in order to avoid confusion
> and tie in with the other meanings of the required syntax.
>
> -gps
>
___
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/python-dev@python.org/message/2ZHLIOVQG27EUJLXQYMTQUB6Z67MNJ4I/
Code of Conduct: http://python.org/psf/codeofconduct/


[Python-Dev] Re: a name for the ExceptHandler.type when it is a literal tuple of types

2021-05-08 Thread Gregory P. Smith
On Sat, May 8, 2021 at 8:54 AM Thomas Grainger  wrote:

> That's this bit:
>
> ```
> except (A, B):
>^^
> ```
>
> bpo-43149 currently calls it an "exception group", but that conflicts with
> PEP 654 -- Exception Groups and except*
>
> ```
>
>>>> try:
>...   pass
>... except A, B:
>...   pass
>Traceback (most recent call last):
>SyntaxError: exception group must be parenthesized
> ```
>
> some alternatives:
>
> exception classinfo must be parenthesized (classinfo so named from the
> parameter to issubclass)
> exception sequence must be parenthesized
>
> see also:
>
> - https://github.com/python/cpython/pull/24467#discussion_r628756347
> - https://www.python.org/dev/peps/pep-0654/


Given it requires ()s it is probably better to call it an "exception
sequence" or even go fully to "exception tuple" in order to avoid confusion
and tie in with the other meanings of the required syntax.

-gps
___
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/python-dev@python.org/message/Y7SPN4WSXXFPAZITS2PMF2PRSVX3H5SE/
Code of Conduct: http://python.org/psf/codeofconduct/