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

Update email.utils for 3.13 #12336

Merged
merged 6 commits into from
Jul 13, 2024
Merged

Conversation

max-muoto
Copy link
Contributor

No description provided.

@max-muoto max-muoto marked this pull request as draft July 13, 2024 20:29
@max-muoto max-muoto marked this pull request as ready for review July 13, 2024 20:31
def parseaddr(addr: str | None) -> tuple[str, str]: ...

if sys.version_info >= (3, 13):
def parseaddr(addr: str, *, strict: bool = True) -> tuple[str, str]: ...
Copy link
Contributor Author

@max-muoto max-muoto Jul 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

None works, since parseaddr is designed to handle malformed inputs, but I don't it makes sense to accepr for either the new or old definition, to avoid mistakes.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let me fix that.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually - I'm not sure we want to add that. It just seems to be trying to handle the most flexible input possible, no?

Copy link
Contributor Author

@max-muoto max-muoto Jul 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should add back None in that case as well I would say, if we really want to be true to every value it can accept at runtime.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It does also have a thing where it returns ('', '') for any non-str input, but this is a different check. I think we should add list[str] because it has specific handling for this type.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment has been minimized.

stdlib/email/utils.pyi Outdated Show resolved Hide resolved
stdlib/email/utils.pyi Outdated Show resolved Hide resolved
max-muoto and others added 4 commits July 13, 2024 15:55
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Copy link
Contributor

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

@JelleZijlstra JelleZijlstra merged commit 35b84f2 into python:main Jul 13, 2024
63 checks passed
max-muoto added a commit to max-muoto/typeshed that referenced this pull request Jul 23, 2024
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
max-muoto added a commit to max-muoto/typeshed that referenced this pull request Sep 8, 2024
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
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.

2 participants