[Python-Dev] Restricted API versioning
Larry Hastings
larry at hastings.org
Sun Jun 24 01:51:52 CEST 2012
On 06/23/2012 04:44 PM, Chris Angelico wrote:
> On Sun, Jun 24, 2012 at 9:40 AM, Christian Heimes<lists at cheimes.de> wrote:
>> +1 for the general idea and for using Py_LIMITED_API. I still like my
>> idea of a simple macro based on Include/patchlevel.h, for example:
>>
>> #define Py_API_VERSION(major, minor, micro) \
>> (((major)<< 24) | ((minor)<< 16) | ((micro)<< 8))
>>
>> #if Py_LIMITED_API+0>= Py_API_VERSION(3, 3, 0)
>> #endif
> This strikes me as in opposition to the Python-level policy of duck
> typing. Would it be more appropriate to, instead of asking if it's
> Python 3.3.0, ask if it's a Python that supports PY_FEATURE_FOOBAR? Or
> would that result in an unnecessary proliferation of flag macros?
python != c
Or, if you prefer
python is not c
C lacks niceties like constructors, destructors, and default arguments.
I think C APIs need to be much more precise than Python APIs;
mix-n-match C APIs would be an invitation to heartburn and migranes.
//arry/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20120623/1d755cfd/attachment.html>
More information about the Python-Dev
mailing list