robertwb / issues-import-test

0 stars 0 forks source link

compiler crash on .pxd -> .py definitions #432

Open robertwb opened 15 years ago

robertwb commented 15 years ago

On Apr 13, 2009, at 2:14 PM, Riccardo Murri wrote:

  # iter.py
  class Iter(object):

      """A docstring."""

      def __iter__(self):
          return self

      def __next__(self):
          raise StopIteration

I'm augmenting the pure Python code with the following .pxd file::

  # iter.pxd
  cpdef class Iter(object)

The Cython-0.11 invocation "cython iter.py" dies with the following backtrace::

  $ cython iter.py

  Error converting Pyrex file to C:
  ------------------------------------------------------------
  ...
  class Iter(object):

      """A docstring."""

      def __iter__(self):
     ^
  ------------------------------------------------------------

  /tmp/iter.py:5:4: Compiler crash in AlignFunctionDefinitions

  ModuleNode.body = StatListNode(iter.py:1:0)
  StatListNode.stats[= PyClassDefNode(iter.py:1:0,
      doc = 'A docstring.',
      name = u'Iter')
  CClassDefNode.body = StatListNode(iter.py:5:4)
  StatListNode.stats[0](0]) = DefNode(iter.py:5:4,
      name = u'__iter__',
      num_required_args = 1,
      reqd_kw_flags_cname = '0')

Migrated from http://trac.cython.org/ticket/279

robertwb commented 15 years ago

scoder changed The invalid "cpdef" part of this is ticket http://cython.trac.org/ticket/280.

robertwb commented 8 years ago

linkmauve changed A proposed fix is available here: https://github.com/cython/cython/pull/469