Dag Sverre Seljebotn wrote:

> This is hardly satisfying, and SOME kind of solution is needed here. If
> only to prevent subtle bugs from mixing types from numpy.pxd with other
> types in arithmetic!

If you do this, you might like to consider a syntax
I suggested earlier:

   ctypedef some int foo
   ctypedef some float bar

etc.

I think this is better than something like int? or
?int because it makes it clear that the uncertainty
is about the size of the type, not its basic kind.

Some thoughts on implementation:

* Treat it as having a rank higher than any known
rank for that kind. That way arithmetic etc. between
known and unknown sizes will get promoted to an
unknown size.

* Only allow it to be introduced via a typedef, so
that generated code always has a named type for the
C compiler to go on.

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

Reply via email to