Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
robertwb opened this issue Apr 14, 2009 · 3 comments
Closed

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

robertwb opened this issue Apr 14, 2009 · 3 comments

Comments

@robertwb
Copy link
Contributor

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
Copy link
Contributor Author

robertwb commented Apr 14, 2009

scoder commented

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

@robertwb
Copy link
Contributor Author

robertwb commented Dec 1, 2015

linkmauve commented

A proposed fix is available here: #469

@robertwb robertwb added this to the wishlist milestone Aug 16, 2016
@scoder
Copy link
Contributor

scoder commented Jul 24, 2017

Fixed by the pull request.

@scoder scoder closed this as completed Jul 24, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants