Skip to main content

Simple Python extensions.

Project description


.. image::

Several simple extensions that add some nifty features to Python.

NEWS: There is now a PyExt newsgroup on Google Groups. See!forum/pyext.

Some features:

- Function overloading
- Switch statement
- Runtime module creation
- Tail recursion removal
- Python 2 function annotations
- Python 2 safe tuple unpacking


Function overloading::

def f(a): print 'Function 1 called'
def f(a, b): print 'Function 2 called'

f(1, 2)

Switch statement::

with switch(1):
if case(0): print 'Awkward...'; case.quit() # case.quit() is the same as break
if case(2): print '???'
if case(1): print 'Phew! It works!'
if case.default(): print 'Ummmm...'

Function annotations::

@fannotate('Return annotation', a=1, b=2)
def x(a, b):
return 0


- Add some more tests

.. note:: Please ignore this project's messy commit history(several commits under invalid_email_address, about 20 commits labeled Initial). I was trying to use hg-git and kept goofing stuff up.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for pyext, version 0.6
Filename, size File type Python version Upload date Hashes
Filename, size pyext-0.6.tar.gz (7.3 kB) File type Source Python version None Upload date Hashes View
Filename, size pyext-0.7.tar.gz (7.8 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page