I am in the process of converting a largish Python program to Cython. 
One thing my software does throughout is to create package-specific 
exception types, so that exception handler code can accurately catch 
only certain types of exceptions.  For example, one subpackage defines 
the following exception types:

----
import Crux

class Exception(Crux.Exception):
     pass

class ValueError(Exception, ValueError):
     def __init__(self, str):
         self._str = str

     def __str__(self):
         return self._str
----

As you can see, this code defines module-specific classes with the same 
names as the top-level Python exception types.  The Cython compiler 
complains with errors like:

/home/jasone/crux/crux/./src/Crux/CTMatrix.pyx:19:0: Assignment to 
non-lvalue 'Exception'

Is this a "feature" or a bug in Cython?

Thanks,
Jason
_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to