[issue34498] Python 3.7+ break on singledispatch_function.register(pseudo_type), which Python 3.6 accepted

2021-12-30 Thread wrobell


wrobell  added the comment:

To add bit more context, there is a discussion about Python types and
annotation types, where suggestion of closing this bug has been raised

https://github.com/python/mypy/issues/9773

The discussion is about the need of distinction between Python types and
annotation types, and explicit terminology in the documentation.

Closing this bug gives clearer indication to tools like Mypy, how to deal
with annotation types used with singledispatch.

IMHO, it is small step towards more explict Python type system, whatever
its limitations.

--
nosy: +wrobell

___
Python tracker 

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



[issue34498] Python 3.7+ break on singledispatch_function.register(pseudo_type), which Python 3.6 accepted

2021-12-30 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
resolution:  -> wont fix
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



[issue34498] Python 3.7+ break on singledispatch_function.register(pseudo_type), which Python 3.6 accepted

2021-12-29 Thread Guido van Rossum


Guido van Rossum  added the comment:

Let's close this issue as "won't fix" then. The solution "use 
collections.abc.Sequence" makes sense.

--

___
Python tracker 

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



[issue34498] Python 3.7+ break on singledispatch_function.register(pseudo_type), which Python 3.6 accepted

2021-12-29 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

The original issue is about dispatching on non-parametrized generics like 
typing.Sequence. isinstance([], typing.Sequence) works, so it could be possible 
to support dispatching on typing.Sequence. But I have doubts that it is worth 
to revive such feature, because it needs some effort, and you can use 
collections.abc.Sequence instead.

But there is a conflict between using annotations in singledispatch() and MyPy 
(issue46191).

--

___
Python tracker 

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



[issue34498] Python 3.7+ break on singledispatch_function.register(pseudo_type), which Python 3.6 accepted

2021-12-28 Thread Alex Waygood


Alex Waygood  added the comment:

Guido: Serhiy fixed this very recently in Issue46032.

The documentation should probably be improved, however, in my opinion; there's 
currently nothing officially stating that GenericAlias/NewType/typing aliases 
are unsupported.

Support for singledispatch.register(union_type) was also recently added in 
Issue46014, but has yet to be documented.

--

___
Python tracker 

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



[issue34498] Python 3.7+ break on singledispatch_function.register(pseudo_type), which Python 3.6 accepted

2021-12-28 Thread Guido van Rossum


Guido van Rossum  added the comment:

There's no point in lamenting the compatibility with Python 3.6, it's water 
under the bridge. Dispatching on types like list[int] or types generated by 
NewType is not realistic. Maybe the only thing left to do is to raise an error 
on registration when the type is e.g. list[int]? Currently that passes, but 
then attempting to dispatch on *anything* fails with TypeError: issubclass() 
argument 2 cannot be a parameterized generic

--
nosy: +gvanrossum, serhiy.storchaka

___
Python tracker 

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



[issue34498] Python 3.7+ break on singledispatch_function.register(pseudo_type), which Python 3.6 accepted

2021-11-09 Thread Alex Waygood


Change by Alex Waygood :


--
keywords: +patch
nosy: +AlexWaygood
nosy_count: 8.0 -> 9.0
pull_requests: +27759
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/29508

___
Python tracker 

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



[issue34498] Python 3.7+ break on singledispatch_function.register(pseudo_type), which Python 3.6 accepted

2021-09-07 Thread Irit Katriel


Change by Irit Katriel :


--
title: Python 3.7 breaks on singledispatch_function.register(pseudo_type), 
which Python 3.6 accepted -> Python 3.7+ break on 
singledispatch_function.register(pseudo_type), which Python 3.6 accepted

___
Python tracker 

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