Alex Waygood <alex.wayg...@gmail.com> added the comment:

My opinion is that supporting `GenericAlias` here would be a bad idea. 
Associating an implementation of the function with the argument type 
`list[str]` is ambiguous. Would this implementation be called if any argument 
of type `list` was supplied, or would it only be called if all elements in the 
list were of type `str`?

The first option would be efficient, simple, and similar to the way 
singledispatch treats most other argument-types. However, it would be 
unintuitive.

The second option would be more intuitive, but could be extremely inefficient 
if a very long list was passed in. It would also make the code more complicated.

----------
nosy: +AlexWaygood, lukasz.langa

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue46032>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to