Skip to content

Conversation

@srittau
Copy link
Collaborator

@srittau srittau commented Jun 4, 2024

@srittau
Copy link
Collaborator Author

srittau commented Jun 4, 2024

See also #12088 and #12092 for prior discussion.

@github-actions

This comment has been minimized.

@github-actions
Copy link
Contributor

github-actions bot commented Jun 4, 2024

Diff from mypy_primer, showing the effect of this PR on open source code:

mitmproxy (https://github.com/mitmproxy/mitmproxy)
+ mitmproxy/log.py:193: error: Argument "level" to "log" of "Logger" has incompatible type "str"; expected "int"  [arg-type]

pytest (https://github.com/pytest-dev/pytest)
+ src/_pytest/logging.py:520: error: Argument 1 to "getLevelName" has incompatible type "str"; expected "int"  [arg-type]

mkosi (https://github.com/systemd/mkosi)
+ mkosi/log.py:92:55: error: Argument 1 to "getLevelName" has incompatible type "str"; expected "int"  [arg-type]

@srittau
Copy link
Collaborator Author

srittau commented Jun 4, 2024

Looking at the primer output: mitmproxy uses it in a method that's deprecated itself, pytest's use looks valid, although it could use more explicit code instead, and mkosi's use is unnecessary, as setLevel accepts str levels.

@github-actions
Copy link
Contributor

github-actions bot commented Jun 4, 2024

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

@JelleZijlstra JelleZijlstra merged commit dc504f5 into python:main Jun 20, 2024
@srittau srittau deleted the get-level-name branch June 20, 2024 08:55
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