Fix public extensions declared in pxd files.
authorRobert Bradshaw <robertwb@math.washington.edu>
Sat, 16 Aug 2008 11:25:51 +0000 (04:25 -0700)
committerRobert Bradshaw <robertwb@math.washington.edu>
Sat, 16 Aug 2008 11:25:51 +0000 (04:25 -0700)
Cython/Compiler/Nodes.py
tests/run/extmember.pyx

index d1a418c958d92cfa9e375e41d3ebaae6840cff1c..a67dffa556f474c4a025730eef63999b00aa3232 100644 (file)
@@ -2151,15 +2151,6 @@ class CClassDefNode(ClassDefNode):
         if self.doc and Options.docstrings:
             scope.doc = embed_position(self.pos, self.doc)
             
-        if has_body and not self.in_pxd:
-            # transforms not yet run on pxd files
-            from ParseTreeTransforms import AnalyseDeclarationsTransform
-            transform = AnalyseDeclarationsTransform(None)
-            for entry in scope.var_entries:
-                if hasattr(entry, 'needs_property'):
-                    property = transform.create_Property(entry)
-                    self.body.stats.append(property)
-
         if has_body:
             self.body.analyse_declarations(scope)
             if self.in_pxd:
index 86faeed58a494721fe0b53d5719d5a9176c1240f..c1b958a62777762d424a9c2dcbd03dc5762c797f 100644 (file)
@@ -7,7 +7,21 @@ __doc__ = """
     >>> s.e is s
     True
     >>> s.e = None
+
+    >>> s = Bot()
+    >>> s.e = s
+    >>> s.e = 1
+    Traceback (most recent call last):
+    TypeError: Cannot convert int to extmember.Bot
+    >>> s.e is s
+    True
+    >>> s.e = None
 """
 
+# declared in the pxd
 cdef class Spam:
-       cdef public Spam e
+    pass
+
+# not declared in the pxd
+cdef class Bot:
+    cdef public Bot e