Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save east825/e90b9e625708735909d7489f106c8a49 to your computer and use it in GitHub Desktop.
Save east825/e90b9e625708735909d7489f106c8a49 to your computer and use it in GitHub Desktop.
from collections import defaultdict, OrderedDict
from typing import Dict, overload, TypeVar
T = TypeVar('T')
@overload
def func(foo: T, bar) -> Dict[T, int]:
return defaultdict(int)
@overload
def func(baz=42):
return OrderedDict()
def func(**kwargs):
return kwargs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment