hi,
thanks for the code... that helped me to compile the *.pyx module.however, i
still missing something:
i thought that cdef class can't inherit python objects(at least for py
2.6).however,if i could avoid defining my functions
as cdef and it still works when using it with cython classes that would be ok
for me...now the issue is this one, if i define my class like
this:
cdef extern from "Python.h":
ctypedef class __builtin__.Exception [object PyBaseExceptionObject]:
pass
cpdef class DuplicatedNameError(Exception):
pass
when a DuplicatedNameError occurs, did it calls the python build in class
Exeption or shall' i impliment my self the class Exception as
in the expemle
(http://code.google.com/p/mpi4py/source/browse/trunk/src/MPI/ExceptionC.pyx)
ps: 'cause there is always one
is there any way to find an equivalent of abstractproprety,
abstractmethod for *.pyx modules.that would be really helpful.
finallly, yes indeed...i meant python 2.6 (newbie mistake ;-)
> Date: Tue, 26 May 2009 17:51:53 -0300
> From: [email protected]
> To: [email protected]
> Subject: Re: [Cython] cython code optimisation...misc
>
> On Tue, May 26, 2009 at 11:35 AM, OUARDA MEHDI <[email protected]> wrote:
> > hello,
> > in fact I'm rewriting (in cython 2.6) a python code of a simulator in order
> > to optimize the slowest functions.
>
> Did you mean Python 2.6?
>
> > i've a couple of questions....
> > is there any equivalent of abstractproprety, abstractmethod in cython ?and
> > how to use it
>
> Are talking about the new ABC stuff in Py2.6/3.0? Mmm... not sure if
> they will work.
>
> > is there any way to inherit from builtin classes in cython like class
> > Exception?... any trick to do something equivalent will be welcome
> > here is an exemple:
> > class DuplicateNameError(Exception):
> > pass
> > when i define my class as cpdef... an error occurs while compiling...here is
> > the message i get:
> > /home/tenninos/stage/arboris-python/src/misc.pyx:19:6: 'Exception' is not a
> > type name building 'misc' extension
> >
>
> Do you really need your exceptions to be cdef classes? That would not
> work on Py < 2.5... Anyway (perhaps being compatible with older Python
> is not an issue for you), look the first lines of this code, that
> should work. Disclaimer: I've not tested this for some time, that code
> is there just for reference, I'm not currently using it in my project
> just because of the compatibility with Py2.3 and Py2.4:
>
> http://code.google.com/p/mpi4py/source/browse/trunk/src/MPI/ExceptionC.pyx
>
>
> --
> Lisandro Dalcín
> ---------------
> Centro Internacional de Métodos Computacionales en Ingeniería (CIMEC)
> Instituto de Desarrollo Tecnológico para la Industria Química (INTEC)
> Consejo Nacional de Investigaciones Científicas y Técnicas (CONICET)
> PTLC - Güemes 3450, (3000) Santa Fe, Argentina
> Tel/Fax: +54-(0)342-451.1594
> _______________________________________________
> Cython-dev mailing list
> [email protected]
> http://codespeak.net/mailman/listinfo/cython-dev
_________________________________________________________________
Vous voulez savoir ce que vous pouvez faire avec le nouveau Windows Live ?
Lancez-vous !
http://www.microsoft.com/windows/windowslive/default.aspx_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev