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

Add return type to fields.Email.__init__ so that it's not untyped #2018

Merged
merged 1 commit into from
Aug 22, 2022

Conversation

kkirsche
Copy link
Contributor

This merge request adds a type hint to fields.Email's `init method to avoid no untyped call errors in mypy for library consumers.

@lafrech
Copy link
Member

lafrech commented Jul 25, 2022

Is this specific to Email field?

@kkirsche
Copy link
Contributor Author

This was the only field from marshmallow in my codebase that was triggering this mypy behavior. I'm not sure if any others do though

@lafrech
Copy link
Member

lafrech commented Aug 18, 2022

From those discussions

Explicit -> None is needed if init func has no argument. I guess *args and **kwargs don't count.

Form a quick check, Email is the only concerned field. Although IPInterface.__init__ lacks typing (fixed in #2036).

@lafrech lafrech merged commit 9a50159 into marshmallow-code:dev Aug 22, 2022
@lafrech lafrech added the typing label Aug 22, 2022
@kkirsche
Copy link
Contributor Author

Thank you :) I can look at expanding types if you are interested in a future PR, I just wasn't sure what the responsiveness of the team was, so I was rather hesitant to expand the scope too far.

@kkirsche kkirsche deleted the patch-1 branch August 22, 2022 20:20
@lafrech
Copy link
Member

lafrech commented Aug 22, 2022

Well, don't expect us to be quick to review and merge (see current backlog), but quality PRs are absolutely welcome.

(And if you're good at type hinting, I wouldn't mind a helping hand for #1896.)

Thanks!

@kkirsche
Copy link
Contributor Author

Course, I'll take a look when I have a few moments. I've been trying to work a lot more lately with the typeshed team to get feedback from the source about how to use type hints correctly and effectively, so I'm happy to see if I may be able to assist with that. I'll need to pull it down and run mypy against it as currently it looks like the build log was deleted, so can't view the historic error from mypy

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

Successfully merging this pull request may close these issues.

2 participants