[issue38459] typing: Classes that inherit `Generic[...]` indirectly aren't considered generic.

John Lennon report at bugs.python.org
Sun Oct 13 04:41:51 EDT 2019


John Lennon <enjigglypuffcx at gmail.com> added the comment:

However, if I change the signature to:

```python

class SomeImplMapping(GenericMapping[KT, VT]):

```

Everything works just fine. And that's not really clear for me: we already have declared the generic types, we can not change the amount of those arguments, so why do we have to pass the same generic parameters again?

And even if that's the designed way to do things, I would expect the first example to fail not because of the type substitution, but for deriving the `GenericMapping` without generic type arguments provided (as if I'll try to derive `Generic` instead of `Generic[...]`).

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue38459>
_______________________________________


More information about the Python-bugs-list mailing list