benjaminp / six

Python 2 and 3 compatibility library
https://six.readthedocs.io/
MIT License
987 stars 274 forks source link

Add support for PEP 560 #305

Closed ilevkivskyi closed 5 years ago

ilevkivskyi commented 5 years ago

This is mostly important for typing module that is extensively using PEP 560 since Python 3.7. The goal of this PR is to make

class G(six.with_metaclass(ABCMeta, Generic[T])):
    ...

behave equivalently to

class G(Generic[T], metaclass=ABCMeta):
    ...

and

class G(Generic[T]):
    __metaclass__ = ABCMeta

on all Python versions (also with custom metaclasses on Python versions where it is supported).