PEP 561 compliance
See original GitHub issueHi @leycec and the @beartype organisation 👋
I’m currently rewriting large parts of a project of mine, and I’m planning on using beartype 🐻 with it! (because beartype is awesome 😎)
Part of the rewrite involves creating a python module that users will be able to import. Currently, my project is PEP 561 compatible. However, beartype causes some issues with this making it no longer the case.
For instance, if I were to run mypy --strict
on my code, I now get lots of the following errors:
Untyped decorator makes function "..." untyped
Skipping analyzing 'beartype.cave': found module but no type hints or library stubs
Skipping analyzing 'beartype': found module but no type hints or library stubs
This then has the knock on effect that the functions in my project appear untyped when imported, making it no longer PEP 561 compliant.
Assuming beartype is properly annotated, which I’m 200% sure it is, it should hopefully be as simple as adding a py.typed
file in the project directory. See the mypy docs for more info. This could then be another PEP ticked off in the compliance list.
Since you have a lot (and I really do mean a lot) more experience with these different PEPs and type checking than I do, please let me know if I’m missing anything. Thank you for your help and for maintaining this great project.
Issue Analytics
- State:
- Created 3 years ago
- Comments:14 (12 by maintainers)
Top GitHub Comments
@leycec, this seriously was one of the best pieces of code-related texts I had the pleasure of reading 😃 Can’t wait for the Netflix adaptation!
Spoiler alert: The ending is definitely not spoiled, and I am grateful for the reference! I am left wondering if I should feel a little embarrassed by:
The translation is fantastic. (I had to look up what a "Cryptomaoist Edition" was. Spoiler alert: the actual definition is much more mundane than the portmanteau would suggest.)