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

Should there not be type definitions for get as well? #686

Closed
sebbASF opened this issue Jan 24, 2022 · 1 comment
Closed

Should there not be type definitions for get as well? #686

sebbASF opened this issue Jan 24, 2022 · 1 comment

Comments

@sebbASF
Copy link
Contributor

sebbASF commented Jan 24, 2022

def getone(self, key: _S, default: _D) -> Union[_T_co, _D]: ...

When testing 6.0.1 with mypy, I get an error for d.get("key"), but not d.getone("key", None).
Likewise for d.get("key", "val") and d.getone("key", "val")

I would expect these both to pass mypy - or at least to both fail or pass.

@asvetlov
Copy link
Member

Fixed by #688

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

No branches or pull requests

2 participants