Re: [Cython] Likely bug: compilation failure on aliased cimport + subclass interaction

2013-08-22 Thread Matěj Laitl
On 23. 8. 2013 Matěj Laitl wrote:
> I'm attaching a more complete testcase which I'll also submit as a review
> request for convenience.

*cough*, really attaching the second time.

Matěj>From fd318ca5dc2418ebdbc704d9d10321390644ccf8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Mat=C4=9Bj=20Laitl?= 
Date: Thu, 22 Aug 2013 17:55:07 +0200
Subject: [PATCH] Add testcase for cimport+alias+subclass bug

The test may require moving into tests/compile after the bug is fixed.
---
 tests/run/cimport_alias_subclass.pyx| 13 +
 tests/run/cimport_alias_subclass_helper.pxd |  2 ++
 2 files changed, 15 insertions(+)
 create mode 100644 tests/run/cimport_alias_subclass.pyx
 create mode 100644 tests/run/cimport_alias_subclass_helper.pxd

diff --git a/tests/run/cimport_alias_subclass.pyx b/tests/run/cimport_alias_subclass.pyx
new file mode 100644
index 000..afb30eb
--- /dev/null
+++ b/tests/run/cimport_alias_subclass.pyx
@@ -0,0 +1,13 @@
+cimport cimport_alias_subclass_helper as cash
+
+cdef class Derived(cash.Base):
+cdef bint foo(self):
+print "Hello"
+
+def run():
+"""
+>>> run()
+Hello
+"""
+d = Derived()
+d.foo()
diff --git a/tests/run/cimport_alias_subclass_helper.pxd b/tests/run/cimport_alias_subclass_helper.pxd
new file mode 100644
index 000..4e5d168
--- /dev/null
+++ b/tests/run/cimport_alias_subclass_helper.pxd
@@ -0,0 +1,2 @@
+cdef class Base:
+cdef bint foo(self)
-- 
1.8.1.5

___
cython-devel mailing list
cython-devel@python.org
http://mail.python.org/mailman/listinfo/cython-devel


[Cython] Likely bug: compilation failure on aliased cimport + subclass interaction

2013-08-22 Thread Matěj Laitl
Hi,
it seems that when I do:
> cimport foo as f
> 
> cdef class DerivedClass(f.BaseClass):
> pass

I get following compilation errors:
> 3:5: 'BaseClass' is not declared
> 3:5: 'f.pxd' not found
which looks like a bug to me.

When I use plain "cimport foo" + "foo.BaseClass" or "from foo cimport 
BaseClass" + "BaseClass", it works as expected. Cython version 
0.20dev add8091340e (git describe: 0.19-324-gadd8091)

I'm attaching a more complete testcase which I'll also submit as a review 
request for convenience.

Regards,
Matěj Laitl
___
cython-devel mailing list
cython-devel@python.org
http://mail.python.org/mailman/listinfo/cython-devel