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

LoggerAdapter: the extra property is a simple dict #15713

Closed
wants to merge 1 commit into from

Conversation

romuald
Copy link

@romuald romuald commented Jul 19, 2023

Even if not properly documented, the extra property of LoggerAdapter objects is a simple dict and thus can be modified

This PR simply changes the type of the extra property from Mapping (immutable) to dict (mutable)

Even if not properly documented, the extra property of LoggerAdapter
objects is a simple dict and thus can be modified
@AlexWaygood
Copy link
Member

Thanks for the PR! Unfortunately this is vendored code, so this change would just get overwritten in two weeks when we did our next typeshed sync, if we were to merge this. You'll have to make a PR to https://github.com/python/typeshed if you'd like to make changes to this file :)

@romuald
Copy link
Author

romuald commented Jul 19, 2023

@AlexWaygood thanks for the quick response! I'll try there

@romuald romuald deleted the LoggerAdapter-extra-dict branch July 19, 2023 08:54
@github-actions
Copy link
Contributor

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

prefect (https://github.com/PrefectHQ/prefect)
- src/prefect/logging/loggers.py:61: error: Unpacked dict entry 0 has incompatible type "Mapping[str, object] | None"; expected "SupportsKeysAndGetItem[str, object]"  [dict-item]
+ src/prefect/logging/loggers.py:61: error: Unpacked dict entry 0 has incompatible type "dict[str, object] | None"; expected "SupportsKeysAndGetItem[str, object]"  [dict-item]

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