# Path: mididings/overload.py
# def call(args, kwargs, funcs, name=None):
#     def __init__(self, name, docstring):
#     def add(self, f):
#     def __call__(self, *args, **kwargs):
# def _register_overload(f, docstring):
# def mark(f, docstring=None):
#     def call_overload(*args, **kwargs):
#     def __init__(self, *partial_args):
#     def __call__(self, f):
#         def call_overload(*args, **kwargs):
# class _Overload(object):
# class partial(object):


    import unittest2 as unittest
    import unittest
from mididings import overload
        self.assertEqual(foo(23, 42, 69, 123), 3)

        with self.assertRaises(TypeError):
            foo(e=23)

    def test_partial(self):
        @overload.partial((23,))
        def foo(a, b):
            return a, b

        self.assertEqual(foo(42), (23, 42))
        self.assertEqual(foo(23, 42), (23, 42))
        self.assertEqual(foo(b=42), (23, 42))
        self.assertEqual(foo(a=23, b=42), (23, 42))

        with self.assertRaises(TypeError):
            foo()
        with self.assertRaises(TypeError):
            foo(23, 42, 69)

        @overload.partial((23,))
        def bar(a, b, c=123):
            return a, b, c

        self.assertEqual(bar(42), (23, 42, 123))
        self.assertEqual(bar(23, 42), (23, 42, 123))
        self.assertEqual(bar(42, c=123), (23, 42, 123))
        self.assertEqual(bar(23, 42, 123), (23, 42, 123))

        with self.assertRaises(TypeError):

# Path: mididings/overload.py
# def call(args, kwargs, funcs, name=None):
#     def __init__(self, name, docstring):
#     def add(self, f):
#     def __call__(self, *args, **kwargs):
# def _register_overload(f, docstring):
# def mark(f, docstring=None):
#     def call_overload(*args, **kwargs):
#     def __init__(self, *partial_args):
#     def __call__(self, f):
#         def call_overload(*args, **kwargs):
# class _Overload(object):
# class partial(object):


# Path: tests/test_overload.py
    import unittest2 as unittest
    import unittest
from mididings import overload

        self.assertEqual(foo(23, 42, 69, 123), 3)

        with self.assertRaises(TypeError):
            foo(e=23)

    def test_partial(self):
        @overload.partial((23,))
        def foo(a, b):
            return a, b

        self.assertEqual(foo(42), (23, 42))
        self.assertEqual(foo(23, 42), (23, 42))
        self.assertEqual(foo(b=42), (23, 42))
        self.assertEqual(foo(a=23, b=42), (23, 42))

        with self.assertRaises(TypeError):
            foo()
        with self.assertRaises(TypeError):
            foo(23, 42, 69)

        @overload.partial((23,))
        def bar(a, b, c=123):
            return a, b, c

        self.assertEqual(bar(42), (23, 42, 123))
        self.assertEqual(bar(23, 42), (23, 42, 123))
        self.assertEqual(bar(42, c=123), (23, 42, 123))
        self.assertEqual(bar(23, 42, 123), (23, 42, 123))

        with self.assertRaises(TypeError):

            bar()