[Scipy-tickets] [SciPy] #1707: mio5_utils.pyx cythonizing fails with Cython 0.17

SciPy Trac scipy-tickets@scipy....
Tue Jul 24 16:04:40 CDT 2012


#1707: mio5_utils.pyx cythonizing fails with Cython 0.17
----------------------+-----------------------------------------------------
 Reporter:  rgommers  |       Owner:  mbrett     
     Type:  defect    |      Status:  new        
 Priority:  normal    |   Milestone:  Unscheduled
Component:  scipy.io  |     Version:  devel      
 Keywords:            |  
----------------------+-----------------------------------------------------
 From https://github.com/scipy/scipy/pull/274
 {{{
 $ cython  -V
 Cython version 0.17.beta1
 $ cython mio5_utils.pyx
 warning: mio5_utils.pyx:302:16: Unreachable code
 warning: mio5_utils.pyx:481:12: Unreachable code

 Error compiling Cython file:
 ------------------------------------------------------------
 ...
             mod8 = byte_count % 8
             if mod8:
                 self.cstream.seek(8 - mod8, 1)
         return 0

     cpdef inline cnp.ndarray read_numeric(self, int copy=True):
          ^
 ------------------------------------------------------------

 mio5_utils.pyx:412:10: Only final types can have final Python (def/cpdef)
 methods
 }}}
 With Cython 0.16 there's no problem. The explanation by bfroehle on the PR
 is:
 {{{
 It isn't possible to have an inline'd def or cpdef method, as
 otherwise you'd get conflicting results depending on whether you
 called the method from C or Python if a subclass overrode the method.
 }}}

-- 
Ticket URL: <http://projects.scipy.org/scipy/ticket/1707>
SciPy <http://www.scipy.org>
SciPy is open-source software for mathematics, science, and engineering.


More information about the Scipy-tickets mailing list