Uh oh!
There was an error while loading. Please reload this page.
Make several fields read-only for type, staticmethod and classmethod - #7423
Conversation
This comment has been minimized.
This comment has been minimized.
2 similar comments
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Uh oh!
There was an error while loading. Please reload this page.
Co-authored-by: Bas van Beek <43369155+BvB93@users.noreply.github.com>
Diff from mypy_primer, showing the effect of this PR on open source code: pandera (https://github.com/pandera-dev/pandera)
+ pandera/checks.py:74: error: Argument 1 to "ChainMap" has incompatible type "MappingProxyType[str, Any]"; expected "MutableMapping[str, Callable[..., Any]]" [arg-type]+ pandera/model.py:362: error: Need type annotation for "attrs" (hint: "attrs: Dict[<type>, <type>] = ...") [var-annotated]
pydantic (https://github.com/samuelcolvin/pydantic)
+ pydantic/class_validators.py:332: error: Need type annotation for "all_attributes" [var-annotated]+ pydantic/class_validators.py:332: error: Argument 1 to "ChainMap" has incompatible type "*List[MappingProxyType[str, Any]]"; expected "MutableMapping[<nothing>, <nothing>]" [arg-type] |
AlexWaygood
commented
Mar 2, 2022
Unfortunate. I think this has more to do with the stub for @propertydef__dict__(self) ->dict[str, Any]for What do you think, @BvB93? |
BvB93
commented
Mar 2, 2022
In my opinion this is more of a problem with While the discussion on whether |
AlexWaygood
commented
Mar 2, 2022
I suppose this was discussed in depth in:
and the decision then was that this kind of mypy_primer hit was acceptable. |
All of these are read-only at runtime.