Skip to content

Commit baf90aa

Browse files
committed
typeddicts - test unspecified operations with extra keys
1 parent d46f0a5 commit baf90aa

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

conformance/tests/typeddicts_operations.py

+8
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ def func1(variable_key: str, existing_movie: Movie):
5454
# It's not clear from the spec what type this should be.
5555
movie.get("other") # E?
5656

57+
# It's not clear from the spec whether it's allowed.
58+
reveal_type("other" in movie) # E?
5759

5860
movie.clear() # E: clear not allowed
5961
movie.popitem() # E: popitem not allowed
@@ -74,6 +76,12 @@ class MovieOptional(TypedDict, total=False):
7476
movie_optional["name"] # E?
7577
assert_type(movie_optional.get("name"), str | None)
7678

79+
# It's not clear from the spec what type this should be.
80+
reveal_type(movie_optional.get("other")) # E?
81+
82+
# It's not clear from the spec whether it's allowed.
83+
reveal_type("other" in movie_optional) # E?
84+
7785
movie_optional.clear() # E: clear not allowed
7886
movie_optional.popitem() # E: popitem not allowed
7987

0 commit comments

Comments
 (0)