File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed
stdlib/@tests/test_cases/typing Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change 44from typing_extensions import assert_type
55
66
7+ def check_update_method__int_key () -> None :
8+ d : dict [int , int ] = {}
9+ d .update ({1 : 2 })
10+ d .update ([(1 , 2 )])
11+ d .update (a = 3 ) # type: ignore
12+ d .update ({1 : 2 }, a = 3 ) # type: ignore
13+ d .update ([(1 , 2 )], a = 3 ) # type: ignore
14+ d .update ({"" : 3 }) # type: ignore
15+ d .update ({1 : "" }) # type: ignore
16+ d .update ([("" , 3 )]) # type: ignore
17+ d .update ([(3 , "" )]) # type: ignore
18+
19+
20+ def check_update_method__str_key () -> None :
21+ d : dict [str , int ] = {}
22+ d .update ({"" : 2 })
23+ d .update ([("" , 2 )])
24+ d .update (a = 3 )
25+ d .update ({"" : 2 }, a = 3 )
26+ d .update ([("" , 2 )], a = 3 )
27+ d .update ({1 : 3 }) # type: ignore
28+ d .update ({"" : "" }) # type: ignore
29+ d .update ([(1 , 3 )]) # type: ignore
30+ d .update ([("" , "" )]) # type: ignore
31+
32+
733def check_setdefault_method () -> None :
834 d : dict [int , str ] = {}
935 d2 : dict [int , str | None ] = {}
You can’t perform that action at this time.
0 commit comments