Ticket #386 (new enhancement)
Make complex number type from typedef float
| Reported by: | dagss | Owned by: | somebody |
|---|---|---|---|
| Priority: | minor | Milestone: | wishlist |
| Component: | Parsing | Keywords: | |
| Cc: |
Description (last modified by dagss) (diff)
It would seem natural to be able to do
ctypedef double mydouble ctypedef mydouble complex mycomplex
Currently, this is not possible (only float, double and long double -- literally -- are before complex).
This requires changes in two areas:
- Parser currently is hard-coded to not support it
- Utility code is output to support complex numbers (before typedefs); this won't work if one has to output complex numbers based on typedefs. So rather than having ModuleNode? output type definitions, one should probably make a dependency tree out of the PyrexTypes? and ask them to declare themselves to code in a depth-first manner (PS: Must check whether a type is visited with ==, not is or an instance flag!)
Usecase: numpy.pxd would be slightly cleaner with
ctypedef np.float64_t complex np.complex128_t
...although in practice, double is 64-bit everywhere. So it is mostly for the cleanup.
Change History
Note: See
TracTickets for help on using
tickets.
