Hi,

Robert Bradshaw wrote:
> I think using parentheses for type parameterization is the most natural
> thing to do as well. (The only other viable syntax that comes to mind is
> angle brackets, and that's only natural to C++ people).

Ok, I buy that. It would even resemble decorators to a certain extent.


> This makes it valid Python syntax as well.

How is that?


> I think this is orthogonal to PEP 3107, which specifies where the type
> specification should go (and I agree we should support this syntax too).
> The proposal is that anywhere the compiler expects a valid type, a
> parameterized type would work as well.

Would that also allow you to distinguish things like "list" and "any subtype
of list"?


> The more I think about it, the more the plugin approach seems to be the
> right one to take, though I hope a lot can be specified in a .pxd
> without having to write custom plugins. These could be distributed with
> Cython, though not as part of the core compiler (see
> http://wiki.cython.org/declaration )

You could even ship them with Numpy and other projects instead of integrating
them with Cython. Cython will nicely do without Numpy, but if you want to
access Numpy through Cython, you will need Numpy installed first, so that's
the right place to put a numpy.pxd for Cython.

Stefan

(BTW, you really should stop top-posting ...)


_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to