Re: [Python-Dev] The docstring hack for signature information has to go

2014年2月04日 06:54:37 -0800

On 4 February 2014 02:04, Larry Hastings <[email protected]> wrote:
> On 02/03/2014 07:08 AM, Barry Warsaw wrote:
>
> On Feb 03, 2014, at 06:43 AM, Larry Hastings wrote:
>
> But that only fixes part of the problem. Our theoretical extension that
> wants to be binary-compatible with 3.3 and 3.4 still has a problem: how can
> they support signatures? They can't give PyMethodDefEx structures to 3.3,
> it
> will blow up. But if they don't use PyMethodDefEx, they can't have
> signatures.
>
> Can't an extension writer #ifdef around this? Yeah, it's ugly, but it's a
> pretty standard approach for making C extensions multi-version compatible.
>
>
> For source compatibility, yes. But I thought the point of the binary ABI
> was to allow compiling a single extension that worked unmodified with
> multiple versions of Python. If we simply don't support that, then an ifdef
> would be fine.
Then the solution appears straightforward to me: Python 3.4 will not
support providing introspection information through the stable ABI. If
you want to provide signature info for your C extension without an odd
first line in your 3.3 docstring, you must produce version specific
binaries (which allows #ifdef hackery).
Then PEP 457 can address this properly for 3.5 along with the other
issues it needs to cover.
Cheers,
Nick.
-- 
Nick Coghlan | [email protected] | Brisbane, Australia
_______________________________________________
Python-Dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to