How to make a type of a C extension compatible with mypy

Marco Sulla Marco.Sulla.Python at gmail.com
Sat Jan 1 13:49:55 EST 2022


I created a type in a C extension, that is an immutable dict. If I do:

a: mydict[str, str]

it works. But it doesn't work with mypy, as signalled to me by an user:

https://github.com/Marco-Sulla/python-frozendict/issues/39

How can I make it work? I don't know what he means with annotating
methods, and furthermore I suppose I can't do this in C.


More information about the Python-list mailing list