summaryrefslogtreecommitdiffstats
path: root/Lib/compiler/transformer.py
diff options
context:
space:
mode:
authorBrett Cannon <bcannon@gmail.com>2005-04-09 02:30:16 (GMT)
committerBrett Cannon <bcannon@gmail.com>2005-04-09 02:30:16 (GMT)
commitf4189916e366045a44755d453c89d30e5006f84f (patch)
treefb55a279fc5275a7403f523fb546f19baa4c6e17 /Lib/compiler/transformer.py
parent4ebc7e3bd0a3ed0a56b1a0e5816127c18d2ae8ae (diff)
downloadcpython-f4189916e366045a44755d453c89d30e5006f84f.zip
cpython-f4189916e366045a44755d453c89d30e5006f84f.tar.gz
cpython-f4189916e366045a44755d453c89d30e5006f84f.tar.bz2
Flush out support for ``class B(): pass`` syntax by adding support to the
'parser' module and 'compiler' package. Closes patch #1176012. Thanks logistix.
Diffstat (limited to 'Lib/compiler/transformer.py')
-rw-r--r--Lib/compiler/transformer.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/Lib/compiler/transformer.py b/Lib/compiler/transformer.py
index 0c6d148..dfa25b8 100644
--- a/Lib/compiler/transformer.py
+++ b/Lib/compiler/transformer.py
@@ -280,12 +280,14 @@ class Transformer:
return Lambda(names, defaults, flags, code, lineno=nodelist[1][2])
def classdef(self, nodelist):
- # classdef: 'class' NAME ['(' testlist ')'] ':' suite
+ # classdef: 'class' NAME ['(' [testlist] ')'] ':' suite
name = nodelist[1][1]
doc = self.get_docstring(nodelist[-1])
if nodelist[2][0] == token.COLON:
bases = []
+ elif nodelist[3][0] == token.RPAR:
+ bases = []
else:
bases = self.com_bases(nodelist[3])