On 16 December 2010 02:03, Stefan Behnel <stefan...@behnel.de> wrote:
> Lisandro Dalcin, 15.12.2010 20:38:
>> On 15 December 2010 09:02, Arfrever Frehtes Taifersar Arahesis
>>> ======================================================================
>>> ERROR: compiling (c) and running numpy_bufacc_T155
>>> ----------------------------------------------------------------------
>>> FAILED (errors=11)
>>>
>>> === Got errors: ===
>>> 10:9: 'ndarray' is not a type identifier
>>> 173:49: "mode" is not a buffer option
>>
>> The problem here is that the dictionary keywords of
>> __cythonbufferdefaults__ are parsed as BytesLiteral, there is code
>> with "if not mode in buffer_options"  at Buffer.py that fails because
>> "mode" is 'bytes' and "buffer_options" do have 'str' keys...
>>
>> Stefan, could you take a look at this?
>
> Yes, I know. IIRC, NumPy 1.4 *requires* bytes values here, though.

Sorry, what do you mean?

> I don't
> have any NumPy's installed, BTW, especially not in a Py3 build.
>
> I think the right way to parse the dict keys here is as identifiers. I
> usually do
>
>     d = dict(a=1, b=5)
>
> to get this behaviour. Cython transforms this to a literal dict with
> identifier keywords internally. Not sure if this works in a .pxd...
>

Unfortunately, this does not work in a .pxd.. And we still have the
issue of string values, like "strided"

> We could also override the type of the dict keys as identifiers explicitly
> when handling __cythonbufferdefaults__.
>

I thing this is the best option. And I believe that the type of dict
values also needs to be fixed.

-- 
Lisandro Dalcin
---------------
CIMEC (INTEC/CONICET-UNL)
Predio CONICET-Santa Fe
Colectora RN 168 Km 472, Paraje El Pozo
Tel: +54-342-4511594 (ext 1011)
Tel/Fax: +54-342-4511169
_______________________________________________
Cython-dev mailing list
Cython-dev@codespeak.net
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to