File tree Expand file tree Collapse file tree 2 files changed +6
-0
lines changed
Expand file tree Collapse file tree 2 files changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -3937,6 +3937,8 @@ def __getitem__(self, key: Any) -> Any:
39373937 The item value.
39383938 """
39393939 value = super ().__getitem__ (key )
3940+ if isinstance (key , slice ) and isinstance (value , list ):
3941+ return [self ._wrap_recursive (item ) for item in value ]
39403942 # Recursively wrap mutable items retrieved through this proxy.
39413943 return self ._wrap_recursive (value )
39423944
Original file line number Diff line number Diff line change @@ -1505,6 +1505,10 @@ def test_setattr_of_mutable_types(mutable_state: MutableTestState):
15051505 assert isinstance (array [1 ], list )
15061506 assert isinstance (array [2 ], MutableProxy )
15071507 assert isinstance (array [2 ], dict )
1508+ assert isinstance (array [:], list )
1509+ assert not isinstance (array [:], MutableProxy )
1510+ assert isinstance (array [:][1 ], MutableProxy )
1511+ assert isinstance (array [:][1 ], list )
15081512
15091513 assert isinstance (hashmap , MutableProxy )
15101514 assert isinstance (hashmap , dict )
You can’t perform that action at this time.
0 commit comments