Metadata-Version: 2.4
Name: function-overload
Version: 0.1.0
Summary: Add function overloading to Python
Classifier: Intended Audience :: Developers
Classifier: License :: Public Domain
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# Python Function Overload

A function decorator that allows for real function overloading in Python 3.  Not
that `typing.overload` nonsense, but actual function overloading.

This module is a joke, please don't use it in production code.

## Installation

You can install either install this module from the source or from PyPI using
```bash
pip install function-overload
```

## Usage

Overload-decorated function are grouped by name.  The name of the group is 
determined either by the name of the decorated function or by the `name`
argument to the `overload` decorator.

When a overloaded function is called, the arguments are matched against the
signatures of the functions in the group.  The first function whose signature
matches the arguments is called (in the order they were defined).

```python
from overload import overload

@overload
def foo(x: int):
    return x + 1

@overload
def foo(x: str):
    return x + '!'

assert foo(1) == 2
assert foo('hello') == 'hello!'
```
