Skip to main content
Archived

This project has been archived by its maintainers, and is no longer receiving any updates.

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):
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

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.

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.4.tar.gz (6.4 kB view details)

Uploaded Source

File details

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

File metadata

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

File hashes

Hashes for pyext-0.4.tar.gz
Algorithm Hash digest
SHA256 f7e7485cd6cb250ed7757e902f0399e6186edc3e179a707f29339c3046884bcc
MD5 ca0c82f9de1f627f788190f05b577546
BLAKE2b-256 f8483ed10320002642782363f9dbee7c82b6c956abbbf8f71b833f27aa92912d

See more details on using hashes here.

Release history Release notifications | RSS feed

0.6

2 files

0.5.1

1 file

0.5

1 file

This release

0.4 This release

1 file

0.3.1

1 file

0.3

1 file

0.2

1 file

0.1

1 file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page