Skip to main content

Simple Python extensions.

This project has been archived.

The maintainers of this project have marked this project as archived. No new releases are expected.

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.

NEWS: There is now a PyExt newsgroup on Google Groups. See https://groups.google.com/forum/#!forum/pyext.

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):
if case(0): print 'Awkward...'
if case(2): print '???'
if case(1): print 'Phew! It works!'

Function annotations::

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

TODO:

- 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.

Source Distribution

pyext-0.5.1.tar.gz (6.7 kB view details)

Uploaded Source

File details

Details for the file pyext-0.5.1.tar.gz.

File metadata

  • Download URL: pyext-0.5.1.tar.gz
  • Upload date:
  • Size: 6.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pyext-0.5.1.tar.gz
Algorithm Hash digest
SHA256 0f6cb43a2c1f472f3ab074dbb8cf02dd7cde83ae58e2ece46025d88f92b31660
MD5 f59e382ffd13448604487c7254bffad0
BLAKE2b-256 1bb1853e98a2cea49041ee88315287598dd19fd4fc0a251ac8106f83b26ea121

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page