New submission from Serhiy Storchaka <storchaka+cpyt...@gmail.com>:

typing._GenericAlias represents two different types: user defined (like 
List[int]) and special (like List). They have different behavior, and common 
methods contain special cases.

The proposed PR rewrites the implementation in more object-oriented paradigm: 
different classes for different behavior. _GenericAlias is split on three 
classes: user defined (it may be replaced with GenericAlias in future), 
special, and the base class for common methods. Its subclasses are also split 
on classes for special types Tuple and Callable and for parametrized Callable[] 
and Annotated[]. The work is not finished yet and the code is still complex.

----------
components: Library (Lib)
messages: 367312
nosy: gvanrossum, levkivskyi, serhiy.storchaka
priority: normal
severity: normal
status: open
title: Refactor typing._GenericAlias
type: enhancement
versions: Python 3.9

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

Reply via email to