Opened 4 years ago

Closed 3 years ago

#775 closed defect (fixed)

'memoryview' gets included in the namespace

Reported by: mauro Owned by: somebody
Priority: minor Milestone: 0.19.1
Component: Code Generation Keywords:


The following code:

import pyximport; pyximport.install()
from mv import *

with mv.pyx:

import array
# # commenting the following two lines stops the error being thrown
ar2 = array.array('i',[1,2,3])
cdef int[:] myslice = ar2
# shows that memoryview is in the namespace of my.pyx, if above two lines are not commented

produces the error:

Traceback (most recent call last):
  File "", line 3, in <module>
  File "stringsource", line 323, in View.MemoryView.memoryview.__cinit__ (/home/mauro/.pyxbld/temp.linux-x86_64-3.2/pyrex/mv.c:2945)
TypeError: __cinit__() takes at least 2 positional arguments (1 given)

(cython 016, python 3.2.3)

So, through the "from mv import *" cython's version of memoryview is imported to python-space which is not quite the same as CPython's and causes the error. However, this only happens if a memoryview is used in the .pyx file.

Change History (1)

comment:1 Changed 3 years ago by scoder

  • Milestone changed from wishlist to 0.19.1
  • Resolution set to fixed
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.