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:
487487 "builtins.list" , is_unboxed = False , is_refcounted = True , may_be_immortal = False
488488)
489489
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+
491495dict_rprimitive : Final = RPrimitive ("builtins.dict" , is_unboxed = False , is_refcounted = True )
496+ # An instance of a subclass of dict.
492497
493498# Python set object (or an instance of a subclass of set).
494499set_rprimitive : Final = RPrimitive ("builtins.set" , is_unboxed = False , is_refcounted = True )
@@ -599,7 +604,14 @@ def is_list_rprimitive(rtype: RType) -> TypeGuard[RPrimitive]:
599604
600605
601606def is_dict_rprimitive (rtype : RType ) -> TypeGuard [RPrimitive ]:
602- return isinstance (rtype , RPrimitive ) and rtype .name == "builtins.dict"
607+ return isinstance (rtype , RPrimitive ) and rtype .name in (
608+ "builtins.dict" ,
609+ "builtins.dict[exact]" ,
610+ )
611+
612+
613+ def is_exact_dict_rprimitive (rtype : RType ) -> TypeGuard [RPrimitive ]:
614+ return isinstance (rtype , RPrimitive ) and rtype .name == "builtins.dict[exact]"
603615
604616
605617def is_set_rprimitive (rtype : RType ) -> TypeGuard [RPrimitive ]:
You can’t perform that action at this time.
0 commit comments