typing
typing copied to clipboard
typeddicts - update conformance tests according to the spec
Added missing tests to typeddicts_operations.py based on the current state of https://typing.python.org/en/latest/spec/typeddict.html#supported-and-unsupported-operations
Stumbled upon type checkers having a different behaviour for typed_dict[str], investigated the spec and the spec is clear about type checkers generally rejecting operations with arbitrary strings - so wanted to reflect the spec in conformance tests.
Added tests for:
- Disallowed
popitem. - Not requires keys - spec allows both behaviours.
- Extra keys in
getand within- spec is not certain about this, so I guess it allows both behaviours. - Operations with variable keys - disallowed descructive and non-destructive operations except
.getandin.
Added baseline output commit just for a reference - to confirm that there no other typecheckers version changes at play in the updated output. I can remove it before merge to avoid additional diffs.