File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -487,8 +487,13 @@ def __hash__(self) -> int:
487
487
"builtins.list" , is_unboxed = False , is_refcounted = True , may_be_immortal = False
488
488
)
489
489
490
- # Python dict object (or an instance of a subclass of dict).
490
+ # Python dict object.
491
+ exact_dict_rprimitive : Final = RPrimitive (
492
+ "builtins.dict[exact]" , is_unboxed = False , is_refcounted = True )
493
+ )
494
+
491
495
dict_rprimitive : Final = RPrimitive ("builtins.dict" , is_unboxed = False , is_refcounted = True )
496
+ # An instance of a subclass of dict.
492
497
493
498
# Python set object (or an instance of a subclass of set).
494
499
set_rprimitive : Final = RPrimitive ("builtins.set" , is_unboxed = False , is_refcounted = True )
@@ -608,7 +613,14 @@ def is_list_rprimitive(rtype: RType) -> TypeGuard[RPrimitive]:
608
613
609
614
610
615
def is_dict_rprimitive (rtype : RType ) -> TypeGuard [RPrimitive ]:
611
- return isinstance (rtype , RPrimitive ) and rtype .name == "builtins.dict"
616
+ return isinstance (rtype , RPrimitive ) and rtype .name in (
617
+ "builtins.dict" ,
618
+ "builtins.dict[exact]" ,
619
+ )
620
+
621
+
622
+ def is_exact_dict_rprimitive (rtype : RType ) -> TypeGuard [RPrimitive ]:
623
+ return isinstance (rtype , RPrimitive ) and rtype .name == "builtins.dict[exact]"
612
624
613
625
614
626
def is_set_rprimitive (rtype : RType ) -> TypeGuard [RPrimitive ]:
You can’t perform that action at this time.
0 commit comments