Closed
Description
I'm currently trying to type an API using the signal
module. At some point, we pass a callback that has the type signal._Handler
(see: https://github.com/python/typeshed/blob/master/stdlib/3/signal.pyi#L73), which is not in the signal
module, but in typeshed.
If I try to import it, I get an error, and I could not find the proper way to do so in the documentation.
Activity
JukkaL commentedon Apr 9, 2020
Yes, it would be good to document this clearly, as the workaround is not obvious.
You can use the same approach used to deal with import cycles: https://mypy.readthedocs.io/en/stable/common_issues.html#import-cycles
kshitij86 commentedon Jun 17, 2020
@JukkaL I want to contribute to mypy. Could you assign this issue to me?
JukkaL commentedon Jun 19, 2020
@kshitij86 Your contribution is welcome! This is now assigned to you.
mfarrugi commentedon Sep 3, 2020
https://github.com/python/typeshed/blob/master/stdlib/2and3/_typeshed/__init__.pyi#L3-L13 is a good starting point for an explanation.
For any types that are only available in stubs, you must do
gvanrossum commentedon Sep 3, 2020
@mfarrugi If you want to give it a try you’re welcome.
Document PEP 585, 563, 604 and more.
Document PEP 585, 563, 604 and more (#9763)
Document PEP 585, 563, 604 and more (#9763)