Brief DescriptionPyrex lets you write code that mixes Python and C data types any way you want, and compiles it into a C extension for Python.Documentation
Download
Pyrex-0.9.8.5.tar.gz (242223 bytes, 2008-08-27) Mercurial Repository and UpdatesPrevious ReleasesPyrex requires Python 2.3 or later, both to run the Pyrex compiler and to use the generated extension modules.NewsVersion 0.9.8.5
Version 0.9.8.4
Version 0.9.8.3
Version 0.9.8.2
Version 0.9.8.1
Version 0.9.8There are new features in the following areas:
Version 0.9.7.2Fix for the other half of the integer indexing problem. Version 0.9.7.1Oops! I goofed with the integer indexing optimisation. This version should fix it. For-From Loop UndeprecatedI
seem to have stirred a bit of a panic with the change to the integer
for-loop syntax. I've decided to remove the deprecation warning and
continue to support the old syntax for the foreseeable future. If you
don't want to wait for the next release, you can apply the following
patch to eliminate the warning. I'll also try not to introduce any more incompatible changes without a very good reason and plenty of warning. Version 0.9.7Syntax Change The integer for-loop syntax has been streamlined. Instead of for i in x < i < y it is now simply for x < i < y More efficient code
Version 0.9.6.4Version 0.9.6.3
Version 0.9.6.2Another
couple of minor fixes. Version 0.9.6.1
Fixes some minor problems in the new release. Version 0.9.6New Features:
C function
cimporting and C API generation, fast builtin function calls,
conditional compilation, GIL acquisition and release. See Changes in Pyrex 0.9.6
for more
details.
Plus a large number of bug fixes and minor improvements. Old NewsPatchesWARNING: I have not reviewed or tested these patches - use them at your own risk.Sam Rushing has submitted a patch to Pyrex 0.9.3.1 which adds some conditional compilation facilities. Old PatchesLenard
Lindstrom contributed some patches to Pyrex 0.9.3.1 to
improve
the C++ compatibility
of the generated code. Since 0.9.4 these should no longer be necessary. PackagesThese packages are maintained by others, so they may not be up to date with the latest version.RedHat/Fedora Pyrex-0.9.3.1-1.noarch.rpm
Pyrex-0.9.3.1-1.src.rpm Contributed
by Giovanni Bajo Fedora Core 1 Fedora Core 2 Contributed
by Jan
Ondrej Related ToolsMailing ListYou
are invited
to subscribe to the Pyrex
Mailing
List for all Pyrex-related discussions.
Thanks are due to Johannes Grødem of Copyleft Software for setting up and hosting this list at the request of Joakim Ziegler. Discussion of Pyrex is also welcome on the Python newsgroup, comp.lang.python. IRC Channelirc.freenode.net #pyrex I don't normally use IRC myself, but you may find someone there who's able to help you. AuthorGreg Ewing (greg.ewing@canterbury.ac.nz ) |
Example Pyrex modules# # Calculate prime numbers # def primes(int kmax): cdef int n, k, i cdef int p[1000] result = [] if kmax > 1000: kmax = 1000 k = 0 n = 2 while k < kmax: i = 0 while i < k and n % p[i] <> 0: i = i + 1 if i == k: p[k] = n k = k + 1 result.append(n) n = n + 1 return result # # Defining an extension type # cdef class Spam: cdef int amount def __new__(self): self.amount = 0 def get_amount(self): return self.amount def set_amount(self, new_amount): self.amount = new_amount def describe(self): print self.amount, "tons of spam!" |