[Cython] [Refactor] Emulated types

Carlos Pita carlosjosepita at gmail.com
Sun Oct 18 13:45:56 EDT 2015


I'm in the process of refactoring the emulated types in Shadow, in order to
simplify a bit that part of the module. Ultimately I want to add support
for declaring typed memory views in pure python (currently it's only
possible to declare them as strings, Shadow does implement the slicing part
-tho it's messy here- but the parser is unable to get them right from
decorators). But before that I'd like to simplify things a bit, as I've
said, and before that I need to get a good grasp of what I'm trying to
simplify, so I'd better hear your opinion about the following points first:

1) Shadow allows creating array types like this: cython.array(cython.int,
10) but the compiler will complain that cython.array is an unknown type.

2) Furthermore Shadow allows to instantiate every type: cython.int(10),
cython.array(cython.int, 20)(), etc. The compiler rejects all these
constructs, so I see little point in supporting this feature.

I think that disallowing these features (AFAICS completely unsupported by
the compiler) will simplify the code a lot and will allow to merge the
"shameless copy" section in a more coherent fashion. Is there any
compelling reason to keep them? What is/was their rationale?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/cython-devel/attachments/20151018/b0121f5f/attachment.html>

More information about the cython-devel mailing list