File tree Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -393,6 +393,9 @@ def __getitem__(self, key: Any) -> Any:
393393 def __contains__ (self , key : Any ) -> bool :
394394 return key in self ._get_object_with_check () # type: ignore
395395
396+ def __iter__ (self ) -> Any :
397+ return self ._get_object_with_check ().__iter__ () # type: ignore
398+
396399 def __float__ (self ) -> str :
397400 # in this case we are looking for the pointed data
398401 return self .get_object ().__float__ () # type: ignore
Original file line number Diff line number Diff line change @@ -1039,6 +1039,13 @@ def test_indirect_object_contains():
10391039 assert "/Producer" in indirect_object
10401040
10411041
1042+ def test_indirect_object_iter ():
1043+ writer = PdfWriter ()
1044+ indirect_object = IndirectObject (1 , 0 , writer )
1045+ assert "foo" not in list (indirect_object )
1046+ assert "/Producer" in list (indirect_object )
1047+
1048+
10421049def test_array_operators ():
10431050 a = ArrayObject (
10441051 [
You can’t perform that action at this time.
0 commit comments