-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Please consider fixing type annotations #39
Comments
I have no knowledge about this. If you want to create a PR, I can consider it :) |
In the current design the frozendict inherits from |
@peku33 Where are you finding |
In my code. |
@peku33 I see because |
Well, this is true for the pure Py version, not for the C extension, that is the default from version 2.2.0 (the current one).
I think I can add it. The problem is I really don't know how. I admit I never used type hinting. I have to study. |
I think for python below 3.9 (which introduces the typed This can possibly be done with |
Why would you add it?
No it should not. A frozendict is not a dict. |
Yes, thing like Mapping is probably fine. I thought the implementation relies on dict underneath and just shadows some methods. The goal is to have typed declaration in class / function footprint with typed methods etc. |
As far as the annotations go, it's true for both versions I imagine. |
This is true for the python implementation, not for the C Extension.
I agree. |
I know nothing about mypy and type annotations, but does #62 also fix this issue? 🤷 |
No. |
Currently, annotations can be enabled by merging #70 , but I need to add some tests before and I don't know where to start. |
@ydirson steps to reproduce? |
Testing this code in a brand new venv with latest frozendict and mypy:
Note that with 2.3.4 the error is as follows, but can be silenced with a simple
|
Reproducible with Python 3.9, but not with Python 3.10. |
Here's my workaround (tested in python3.8):
|
@scottgigante-immunai please see #70 , it will be merged in minutes. |
Well, it seems there were big improvements: Unluckily it's not perfect, and you can see it easily with
Anyway, if nobody is contrary, I think I'll release it when I have time. |
@Marco-Sulla Thanks for the fix! The release would solve some CI issues I'm having :) |
https://github.com/Marco-Sulla/python-frozendict/releases/tag/v2.3.8 I think I can close this issue. For some specific problem about type hints, feel free to open other issues. PS: what I promise, I'll support. |
It appears that there are some missing files:
If you want type annotations to work, you could consider
The text was updated successfully, but these errors were encountered: