Skip to main content

Simple Python extensions.

Project description

PyExt
=====

.. image:: https://travis-ci.org/kirbyfan64/PyExt.png
:target: https://travis-ci.org/kirbyfan64/PyExt

Several simple extensions that add some nifty features to Python.

Some features:

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

Examples:

Function overloading::

@overload.argc(1)
def f(a): print 'Function 1 called'
@overload.argc(2)
def f(a, b): print 'Function 2 called'

f(1)
f(1, 2)

Switch statement::

with switch(1) as case:
if case(0): print 'Awkward...'
if case(2): print '???'
if case(1): print 'Phew! It works!'

Function annotations::

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

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.3
Filename, size File type Python version Upload date Hashes
Filename, size pyext-0.3.tar.gz (5.1 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page