[Cython] python 2.7/3.x and numpy-dev (Dag, I need a quick comment)

Lisandro Dalcin dalcinl at gmail.com
Thu Feb 17 19:11:46 CET 2011

I'm working on a patch to get old, recent, and dev NumPy working in
2.7/3.x. So far, I had success, but I still have two failures like the
one pasted below.

Dag, could you elaborate a bit about the purpose of
__Pyx_BufFmt_CheckString() ? It is just a validity check for pep 3118
format strings? Do you expect the failure below to be hard to fix?

Just in case, the format string that triggers the failure is:

>>> memoryview(np.zeros((1,), dtype=np.dtype('b,i', align=False))).format

FAIL: numpy_test ()
Doctest: numpy_test
Traceback (most recent call last):
  File "/usr/local/python/3.2/lib/python3.2/doctest.py", line 2113, in runTest
    raise self.failureException(self.format_failure(new.getvalue()))
AssertionError: Failed doctest test for numpy_test
  File "/u/dalcinl/Devel/Cython/cython/BUILD/run/c/numpy_test.cpython-32dm.so",
line 1, in numpy_test

File "/u/dalcinl/Devel/Cython/cython/BUILD/run/c/numpy_test.cpython-32dm.so",
line 155, in numpy_test
Failed example:
    print(test_packed_align(np.zeros((1,), dtype=np.dtype('b,i', align=False))))
Exception raised:
    Traceback (most recent call last):
      File "/usr/local/python/3.2/lib/python3.2/doctest.py", line 1248, in __run
        compileflags, 1), test.globs)
      File "<doctest numpy_test[64]>", line 1, in <module>
        print(test_packed_align(np.zeros((1,), dtype=np.dtype('b,i',
      File "numpy_test.pyx", line 404, in numpy_test.test_packed_align
    ValueError: Buffer packing mode currently only allowed at
beginning of format string (this is a defect)

Lisandro Dalcin
Predio CONICET-Santa Fe
Colectora RN 168 Km 472, Paraje El Pozo
3000 Santa Fe, Argentina
Tel: +54-342-4511594 (ext 1011)
Tel/Fax: +54-342-4511169

More information about the cython-devel mailing list