coady / multimethod

Multiple argument dispatching.
https://coady.github.io/multimethod
Other
277 stars 24 forks source link

Overload fails on Optional arguments #90

Closed ipcoder closed 1 year ago

ipcoder commented 1 year ago

Version 1.9.1 python 3.9

Code below fails if annotations is imported:

from __future__ import annotations
from multimethod import  overload

@overload
def g(x: int, c: str = None):
    print(x, c)

@overload
def g(c: str):
    print(c)

print('overload')
g(1)
g('10')
g(11, '12')   # fails HERE
coady commented 1 year ago

Fix will be in the next release.