File tree 1 file changed +15
-1
lines changed
1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change 9
9
10
10
from pandas .compat import StringIO , BytesIO , string_types , text_type
11
11
from pandas import compat
12
- from pandas .core .common import pprint_thing , is_number
12
+ from pandas .core .common import pprint_thing , is_number , AbstractMethodError
13
13
14
14
15
15
try :
@@ -59,6 +59,20 @@ class DtypeWarning(Warning):
59
59
pass
60
60
61
61
62
+ class BaseIterator (object ):
63
+ """Subclass this and provide a "__next__()" method to obtain an iterator.
64
+ Useful only when the object being iterated is non-reusable (e.g. OK for a
65
+ parser, not for an in-memory table, yes for its iterator)."""
66
+ def __iter__ (self ):
67
+ return self
68
+
69
+ def __next__ (self ):
70
+ raise AbstractMethodError (self )
71
+
72
+ if not compat .PY3 :
73
+ BaseIterator .next = lambda self : self .__next__ ()
74
+
75
+
62
76
try :
63
77
from boto .s3 import key
64
78
You can’t perform that action at this time.
0 commit comments