GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||
GeezerVison is showing github.com — Update logging LogRecord msg attribute by aminalaee · Pull Request #9914 · python/typeshed Conversation
Contributor
Closes #9913
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
This comment has been minimized.
|
There was an error while loading. Please reload this page.
|
It looks like this would be a partial revert of #1776 by @rowillia. Since there are no mypy-primer hits, it seems unlikely that too many people are passing non-str objects in this specific situation. And the inconsistency with the attribute annotation is indeed incorrect -- they should either both be |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
But I'm not sure it makes sense to only do a partial revert of #1776. typeshed/stdlib/logging/__init__.pyi Lines 115 to 117 in dd2818a
But |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
In the issue, you wrote:
However, the CPython docs are pretty inconsistent here: later on down in the docs, it's specifically stated that it's okay to pass non-
This seems to me like a bug in the CPython docs: they shouldn't say one thing up at the top, only to say a different thing later down. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
I hadn't really checked the other places, you're right. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Since the CPython docs specifically say that it's okay to pass in arbitrary non-str objects to the msg parameter, I think a better fix would be to keep object for the parameter annotation here, but change this attribute annotation so that it is also object:
typeshed/stdlib/logging/__init__.pyi
Line 392 in dd2818a
| msg: str |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Thank you! A docs PR over at CPython would also be great. If you ping me on the PR, I can help review it :)
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Co-authored-by: Alex Waygood <[email protected]>
|
According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
logging module LogRecord__init__ mismatch
There was an error while loading. Please reload this page.