[Python-Dev] Providing support files to assist 3.x extension authors (original) (raw)
Case Vanhorsen casevh at gmail.com
Sun Dec 20 01:38:45 CET 2009
- Previous message: [Python-Dev] [issue1644818] Allow importing built-in submodules
- Next message: [Python-Dev] Providing support files to assist 3.x extension authors
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Hello,
When I ported gmpy (Python to GMP multiple precision library) to Python 3.x, I began to use PyLong_AsLongAndOverflow frequently. I found the code to slightly faster and cleaner than using PyLong_AsLong and checking for overflow. I looked at making PyLong_AsLongAndOverflow available to Python 2.x. http://bugs.python.org/issue7528 includes a patch that adds PyLong_AsLongAndOverflow to Python 2.7.
I also included a file (py3intcompat.c) that can be included with an extension's source code and provides PyLong_AsLongAndOverflow to earlier versions of Python 2.x. In the bug report, I suggested that py3intcompat.c could be included in the Misc directory and be made available to extension authors. This follows the precedent of pymemcompat.h. But there may be more "compatibility" files that could benefit extension authors. Mark Dickinson suggested that I bring the topic on python-dev.
Several questions come to mind:
Is it reasonable to provide backward compatibility files (either as .h or .c) to provide support to new API calls to extension authors?
If yes, should they be included with the Python source or distributed as a separate entity? (2to3 and/or 3to2 projects, a Wiki page)
If not, and extension authors can create their own compatibility files, are there any specific attribution or copyright messages that must be included? (I assuming the compatibility was done by extracting the code for the new API and tweaking it to run on older versions of Python.)
Thanks in advance for your attention,
Case Van Horsen
- Previous message: [Python-Dev] [issue1644818] Allow importing built-in submodules
- Next message: [Python-Dev] Providing support files to assist 3.x extension authors
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]