A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2010-January/097020.html below:

[Python-Dev] Providing support files to assist 3.x extension authors

[Python-Dev] Providing support files to assist 3.x extension authors [Python-Dev] Providing support files to assist 3.x extension authorsStefan Behnel stefan_ml at behnel.de
Sun Jan 3 09:11:16 CET 2010
Case Vanhorsen, 20.12.2009 01:38:
> 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.

You might want to look at the code Cython generates for integer type 
conversions. We use specialised coercion code that gets generated 
on-the-fly to convert Python long/int from and to all sorts of C integer 
types with compile time (portability) and runtime size/value checks. 
Depending on your needs, this may or may not be faster than the above C-API 
function.

Stefan


More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4