summaryrefslogtreecommitdiff
path: root/Lib/pyclbr.py
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2007-04-21 15:47:16 +0000
committerGeorg Brandl <georg@python.org>2007-04-21 15:47:16 +0000
commita18af4e7a2091d11478754eb66ae387a85535763 (patch)
treefea8015d656cfee937bb6f3d106e6ca0e9f19d78 /Lib/pyclbr.py
parent4d2adcca52ced412d4bdf131b872729c43520d58 (diff)
downloadcpython-git-a18af4e7a2091d11478754eb66ae387a85535763.tar.gz
PEP 3114: rename .next() to .__next__() and add next() builtin.
Diffstat (limited to 'Lib/pyclbr.py')
-rw-r--r--Lib/pyclbr.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/Lib/pyclbr.py b/Lib/pyclbr.py
index fdbfbd46cc..c402a0994a 100644
--- a/Lib/pyclbr.py
+++ b/Lib/pyclbr.py
@@ -161,7 +161,7 @@ def _readmodule(module, path, inpackage=None):
# close previous nested classes and defs
while stack and stack[-1][1] >= thisindent:
del stack[-1]
- tokentype, meth_name, start, end, line = g.next()
+ tokentype, meth_name, start, end, line = next(g)
if tokentype != NAME:
continue # Syntax error
if stack:
@@ -179,11 +179,11 @@ def _readmodule(module, path, inpackage=None):
# close previous nested classes and defs
while stack and stack[-1][1] >= thisindent:
del stack[-1]
- tokentype, class_name, start, end, line = g.next()
+ tokentype, class_name, start, end, line = next(g)
if tokentype != NAME:
continue # Syntax error
# parse what follows the class name
- tokentype, token, start, end, line = g.next()
+ tokentype, token, start, end, line = next(g)
inherit = None
if token == '(':
names = [] # List of superclasses
@@ -191,7 +191,7 @@ def _readmodule(module, path, inpackage=None):
level = 1
super = [] # Tokens making up current superclass
while True:
- tokentype, token, start, end, line = g.next()
+ tokentype, token, start, end, line = next(g)
if token in (')', ',') and level == 1:
n = "".join(super)
if n in dict:
@@ -287,7 +287,7 @@ def _getnamelist(g):
name2 = None
names.append((name, name2))
while token != "," and "\n" not in token:
- tokentype, token, start, end, line = g.next()
+ tokentype, token, start, end, line = next(g)
if token != ",":
break
return names
@@ -297,15 +297,15 @@ def _getname(g):
# name is the dotted name, or None if there was no dotted name,
# and token is the next input token.
parts = []
- tokentype, token, start, end, line = g.next()
+ tokentype, token, start, end, line = next(g)
if tokentype != NAME and token != '*':
return (None, token)
parts.append(token)
while True:
- tokentype, token, start, end, line = g.next()
+ tokentype, token, start, end, line = next(g)
if token != '.':
break
- tokentype, token, start, end, line = g.next()
+ tokentype, token, start, end, line = next(g)
if tokentype != NAME:
break
parts.append(token)