8000 fix type for multiprocessing.log_to_stderr(): allow int level by mikepii · Pull Request #9334 · python/typeshed · GitHub
[go: up one dir, main page]

Skip to content

fix type for multiprocessing.log_to_stderr(): allow int level #9334

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

Conversation

mikepii
Copy link
Contributor
@mikepii mikepii commented Dec 5, 2022

Fixes this complaint:

/foobar.py
  /foobar.py:44:23 - error: Argument of type "int" cannot be assigned to parameter "level" of type "str | None" in function "log_to_stderr"
    Type "int" cannot be assigned to type "str | None"
      "int" is incompatible with "str"
      Type cannot be assigned to type "None" (reportGeneralTypeIssues)

For this code:

import logging
from multiprocessing import log_to_stderr

log_to_stderr(logging.DEBUG)

See also Pyright fallback type stubs MR: microsoft/pyright#4284

@github-actions

This comment has been minimized.

Copy link
Member
@AlexWaygood AlexWaygood left a comment

Choose a reason for hiding this comment

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

Thanks!

@github-actions
Copy link
Contributor
github-actions bot commented Dec 5, 2022

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

@AlexWaygood AlexWaygood merged commit 89fb1d5 into python:main Dec 5, 2022
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
0