Skip to content

Commit 4061b1b

Browse files
authored
[CodeStyle][py2] remove the next method for python2 compatibility (PEP 3114) (#47728)
1 parent fccf664 commit 4061b1b

File tree

2 files changed

+0
-17
lines changed

2 files changed

+0
-17
lines changed

python/paddle/fluid/dataloader/dataloader_iter.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -354,10 +354,6 @@ def _shutdown_thread(self):
354354

355355
self._thread = None
356356

357-
# python2 compatibility
358-
def next(self):
359-
return self.__next__()
360-
361357
def _try_shutdown_all(self):
362358
if not self._shutdown:
363359
try:
@@ -854,10 +850,6 @@ def __next__(self):
854850
if in_profiler_mode():
855851
trace_event.end()
856852

857-
# python2 compatibility
858-
def next(self):
859-
return self.__next__()
860-
861853
def _on_output_batch(self):
862854
for _ in range(len(self._places)):
863855
self._batches_outstanding -= 1

python/paddle/fluid/reader.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -152,15 +152,6 @@ def __init__(self):
152152
def __call__(self):
153153
return self
154154

155-
def next(self):
156-
'''
157-
Get the next item in the DataLoader object. This method
158-
should not be called by users directly. It is used for
159-
implementing iterator protocol of Python 2.x inside
160-
PaddlePaddle framework.
161-
'''
162-
return self.__next__()
163-
164155
def __iter__(self):
165156
raise NotImplementedError()
166157

0 commit comments

Comments
 (0)