Commit 9f01d288 authored by Stefan Behnel's avatar Stefan Behnel

remove duplication of type analysis for base type tuple of Python classes...

remove duplication of type analysis for base type tuple of Python classes (could crash the compiler for non-trivial base class expressions)
parent 83098842
...@@ -7148,7 +7148,6 @@ class PyClassNamespaceNode(ExprNode, ModuleNameMixin): ...@@ -7148,7 +7148,6 @@ class PyClassNamespaceNode(ExprNode, ModuleNameMixin):
subexprs = ['doc'] subexprs = ['doc']
def analyse_types(self, env): def analyse_types(self, env):
self.bases = self.bases.analyse_types(env)
if self.doc: if self.doc:
self.doc = self.doc.analyse_types(env) self.doc = self.doc.analyse_types(env)
self.doc = self.doc.coerce_to_pyobject(env) self.doc = self.doc.coerce_to_pyobject(env)
......
# mode: run
# tag: pyclass
class A(object):
x = 1
class B(object):
x = 2
def cond_if_bases(x):
"""
>>> c = cond_if_bases(True)
>>> c().p
5
>>> c().x
1
>>> c = cond_if_bases(False)
>>> c().p
5
>>> c().x
2
"""
class PyClass(A if x else B):
p = 5
return PyClass
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment