This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author scoder
Recipients Arfrever, Jim.Jewett, Trundle, alex, asvetlov, barry, bfroehle, chris.jerdonek, daniel.urban, david.villa, dmalcolm, eric.smith, ezio.melotti, gregory.p.smith, gvanrossum, jcea, jkloth, larry, mark.dickinson, ncoghlan, pitrou, scoder, serhiy.storchaka, skrah, v+python
Date 2013-02-26.10:25:01
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1361874302.12.0.864326792858.issue16612@psf.upfronthosting.co.za>
In-reply-to
Content
I mentioned it in a couple of places during the discussion, you might just have missed them.

The code that generates the unpacking C code starts here:

https://github.com/cython/cython/blob/4ebc647c2fa54179d25335b2dcf5d845e7fc9a79/Cython/Compiler/Nodes.py#L3068

and extends to here:

https://github.com/cython/cython/blob/4ebc647c2fa54179d25335b2dcf5d845e7fc9a79/Cython/Compiler/Nodes.py#L3641

As I said, Cython actually takes its signature information from normal Python signatures, which you can augment with type annotations in normal C style. So it's not really some fancy DSL behind it, just straight forward stuff like this:

    def func(a, int b, bytes c, unicode s, *, bint flag=False):
        ...

If you want to take a closer look, it's best to just write down a Python function and let Cython translate it for you to see the code that it generates for it.

And it's based on Cython's type system, so argument type conversions use Cython's support for things like copying mappings into structs, for example, or optimised builtin types unboxing.
History
Date User Action Args
2013-02-26 10:25:02scodersetrecipients: + scoder, gvanrossum, barry, gregory.p.smith, jcea, mark.dickinson, ncoghlan, pitrou, larry, eric.smith, jkloth, ezio.melotti, Arfrever, v+python, alex, Trundle, asvetlov, skrah, dmalcolm, daniel.urban, chris.jerdonek, Jim.Jewett, serhiy.storchaka, bfroehle, david.villa
2013-02-26 10:25:02scodersetmessageid: <1361874302.12.0.864326792858.issue16612@psf.upfronthosting.co.za>
2013-02-26 10:25:02scoderlinkissue16612 messages
2013-02-26 10:25:01scodercreate