[issue44635] Convert None to NoneType in the union type constructor

2021-07-15 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44635] Convert None to NoneType in the union type constructor

2021-07-15 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 6dec5255829a31826990ea40ca106cc496570df2 by Serhiy Storchaka in 
branch '3.10':
[3.10] bpo-44635: Convert None to NoneType in the union type constructor 
(GH-27136). (GH-27142)
https://github.com/python/cpython/commit/6dec5255829a31826990ea40ca106cc496570df2


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44635] Convert None to NoneType in the union type constructor

2021-07-14 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
pull_requests: +25684
pull_request: https://github.com/python/cpython/pull/27142

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44635] Convert None to NoneType in the union type constructor

2021-07-14 Thread Ken Jin


Change by Ken Jin :


--
pull_requests: +25683
pull_request: https://github.com/python/cpython/pull/27141

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44635] Convert None to NoneType in the union type constructor

2021-07-14 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset b81cac05606c84958b52ada09f690463a3c7e949 by Serhiy Storchaka in 
branch 'main':
bpo-44635: Convert None to NoneType in the union type constructor (GH-27136)
https://github.com/python/cpython/commit/b81cac05606c84958b52ada09f690463a3c7e949


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44635] Convert None to NoneType in the union type constructor

2021-07-14 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
keywords: +patch
pull_requests: +25679
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/27136

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44635] Convert None to NoneType in the union type constructor

2021-07-14 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
nosy: +gvanrossum, kj

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44635] Convert None to NoneType in the union type constructor

2021-07-14 Thread Serhiy Storchaka


New submission from Serhiy Storchaka :

There is a difference between typing.Union and the builtin union type in 
representing None in __args__:

>>> import typing
>>> typing.Union[int, None].__args__
(, )
>>> typing.Union[int, type(None)].__args__
(, )
>>> (int | None).__args__
(, None)
>>> (int | type(None)).__args__
(, )

The former converts None to NoneType, the latter leaves it as is, and only 
performs conversion in __instancecheck__ and __subclasscheck__. In the 
discussion for issue44606 it was proposed to convert None to NoneType in the 
union type constructor to make more uniform with typing.Union and simplify 
__instancecheck__ and __subclasscheck__.

--
components: Interpreter Core
messages: 397475
nosy: serhiy.storchaka
priority: normal
severity: normal
status: open
title: Convert None to NoneType in the union type constructor
type: enhancement
versions: Python 3.10, Python 3.11

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com