@@ -350,6 +350,28 @@ def test_array2d_tuple_iter_d(self) -> None:
350350 with self .assertRaises (TypeError ):
351351 reversed (it )
352352
353+ def test_array2d_tuple_iter_e (self ) -> None :
354+ a1 = np .array ([[None , 'bb' ], [None , 'dd' ], [3 , None ]])
355+ it = array2d_tuple_iter (a1 )
356+ del a1
357+ self .assertEqual (list (it ), [(None , 'bb' ), (None , 'dd' ), (3 , None )])
358+
359+ def test_array2d_tuple_iter_f (self ) -> None :
360+ a1 = np .array ([[None , 'bb' ], [None , 'dd' ], [3 , None ]])
361+ it1 = array2d_tuple_iter (a1 )
362+ del a1
363+ it2 = iter (it1 )
364+ self .assertEqual (list (it1 ), [(None , 'bb' ), (None , 'dd' ), (3 , None )])
365+ self .assertEqual (list (it2 ), []) # expected behavior
366+
367+ def test_array2d_tuple_iter_g (self ) -> None :
368+ a1 = np .array ([[None , 'bb' ], [None , 'dd' ], [3 , None ]])
369+ it1 = array2d_tuple_iter (a1 )
370+ it2 = array2d_tuple_iter (a1 )
371+ del a1
372+ self .assertEqual (list (it1 ), [(None , 'bb' ), (None , 'dd' ), (3 , None )])
373+ self .assertEqual (list (it2 ), [(None , 'bb' ), (None , 'dd' ), (3 , None )])
374+
353375 #---------------------------------------------------------------------------
354376
355377 def test_isna_element_a (self ) -> None :
0 commit comments