> 1) Having "cdef double a[size]" allocate anything is very against the > Python syntax -- nothing is ever allocated in Python without a function call > and an assignment (same as in Java). To somebody who comes from a strict > Python background and not C, it really looks like only a variable type > declaration, not object allocation. In Cython, this Python way of working is > mostly kept, and this would be a step *away* from Python in terms of the > "feel" of the language.
As other people have mentioned, Cython is (unapologetically) Python with C data types, so this syntax will be at home. > 2) This kind of duplicates the behaviour of the "with" keyword (which is > not present in Cython today (either), but definitely is a goal, and is > present in current Python). I very much like his idea of using with for these things. But, with is 2.5 only and I think this is an important enough issue that it should be a lower level syntax that cython supports. But, with could definitely be used for more complex or custom allocators. Question: does cython have something like a standard library? It seems like such context managers should go there. Also such a standard library would provide a place for lots of commonly used things that shouldn't be in the actual core language. I think that is better than the language itself growing all of these (with) capabilities. I do think that dynamic arrays should be a part of the language though. _______________________________________________ Cython-dev mailing list Cython-dev@codespeak.net http://codespeak.net/mailman/listinfo/cython-dev