[Cython] [cython-users] Cython .pxd introspection: listing defined constants
W. Trevor King
wking at drexel.edu
Tue Feb 22 18:55:43 CET 2011
On Sat, Feb 19, 2011 at 06:31:26PM -0500, W. Trevor King wrote:
> On Sat, Feb 19, 2011 at 02:04:16PM -0800, Robert Bradshaw wrote:
> > On Sat, Feb 19, 2011 at 1:45 PM, W. Trevor King <wking at drexel.edu> wrote:
> > > Ah. Sorry for all the c(p)def/qualifier confusion, but I'm trying to
> > > consolidate the way these are handled in Parsing/Nodes/Symtab and I
> > > want to make sure I don't implement the wrong interpretation. Can you
> > > clarify how one knows if "public" means "expose a read/write Python
> > > interface to this object" or "expose this symbol to external C code"?
> > Public has had several different meanings. I wish there were a spec
> > and full grammer for Cython, but there's not (yet?). The meaning is
> > implicit in the code, and there's enough users out there that we
> > should stay backwards compatible. It may be worth doing some
> > backwards-incompatible normalization before we hit 1.0, but compiling
> > the entire Python grammar is higher priority than that.
> Since I'm going to have lots of similar stuff (classes, enums,
> structs, unions) all with the same (hopefully) cdef/cpdef/visibility
> stuff for members, I'd like to consolidate now. I will of course, add
> special-case code as necessary to support the current syntax, which
> can then be removed whenever you think it is appropriate, but writing
> separate, near-identical handlers for each type seems like a recipe
> for disaster ;).
> I'll look to the code for guidance on public, and try to work out the
> appropriate meaning during the parse phase.
I've been working on a more explicit parser that removes the ambiguity
behind the various visibilities. This will help me ensure proper
impolementation of my cdef-ed enums/structs/..., and make it easier to
update visibility syntax in the future. Take a look and let me know
if you think this is a useful direction to take:
This email may be signed or encrypted with GPG (http://www.gnupg.org).
The GPG signature (if present) will be attached as 'signature.asc'.
For more information, see http://en.wikipedia.org/wiki/Pretty_Good_Privacy
My public key is at http://www.physics.drexel.edu/~wking/pubkey.txt
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 198 bytes
Desc: not available
More information about the cython-devel