Skip to content
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

TypeConversionDict.pop with type #2888

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

MarcinKonowalczyk
Copy link

Proposed implementation of pop with type parameter on TypeConversionDict. Address #2883.

@MarcinKonowalczyk
Copy link
Author

Typing is slightly messy, but I think correct. mypy certainly seems to be happy with it. I've had to battle a bit with ImmutableTypeConversionDict typing, but won in the end.

@davidism davidism modified the milestones: 3.0.3, 3.1.0 May 4, 2024
@pallets pallets deleted a comment from depinsutohap May 7, 2024
@MarcinKonowalczyk
Copy link
Author

@davidism anything else which needs to happen here? (all good if just waiting / no-one gotten to it. just wanna make sure i'm not sitting idle on something i'm supposed to be doing here)

@MarcinKonowalczyk
Copy link
Author

Since I often use this in a non-werkzeug context, I've extracted the TypeConversionDict into a single-file micro-package: https://github.com/MarcinKonowalczyk/type_conversion_dict.

I thought it relevant to post here since i've done quite a bit of test + typing work there. The get and pop signatures are compatible with dict and werzeug.datastructures.TypeConversionDict.

In that implementation i've also added a required kwarg which I find very useful but i don't propose to add it here ( at least not in this PR/Issue. Obv feel free to add it too if you like it :)) )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants