[Cython] [cython-users] Cython .pxd introspection: listing defined constants

W. Trevor King wking at drexel.edu
Thu Mar 3 13:13:02 CET 2011


On Wed, Mar 02, 2011 at 06:08:12PM -0800, Robert Bradshaw wrote:
> On Wed, Mar 2, 2011 at 5:54 PM, W. Trevor King <wking at drexel.edu> wrote:
> > Previous discussions in this thread [1,2] have discussed the issues
> > associated with overloading the 'public' keyword.  For an example of
> > the difficulties this causes, see the ugly workaround [3] in my recent
> > commit [4].  Definately worth fixing this syntax.
> >
> > How do syntax changes with deprecations work?  The Parsing module
> > doesn't seem to be setup to handle things like that.
> 
> It's not.
> 
> We rarely deprecate syntax, and we should at least give people a
> chance to move away from the old syntax first to the new first, so
> we'll have to support both for a bit at least. When we do deprecate
> the old way of doing things, I think we'll just use
> Errors.warning(...).

But how would you know which syntax version the source file was aiming
for?  There should probably be a way to explicitly specify a Cython
syntax version, probably from the command line and/or setup.py file,
e.g.

  pyrex_syntax_version = (<major version>, <minor version>, <sytax bugfix>)

as an argument to Cython.Distutils.extension.Extension, which would
select the appropriate parser.  The default (if the version was not
explicitly set), would be to use the current parser.  With this setup,
projects would only be forced to upgrade if Cython removed support for
their syntax entirely, and they could choose to upgrade whenever was
most convienient for them.

I think the syntax version's major/minor number should probably match
the Cython version in which they were introduced.  Parser fixes and
compatible extensions would bump the <syntax bugfix> number, and you'd
probably want to deprecate buggy versions more quickly.

-- 
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
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/cython-devel/attachments/20110303/f7cfff60/attachment.pgp>


More information about the cython-devel mailing list