-
Notifications
You must be signed in to change notification settings - Fork 17
Closed
Labels
enhancementNew feature or requestNew feature or request
Description
According to PEP484 one can declare type hints using a "comments" format.
It would be good that create_function supports this way of defining the type hints:
func_signature = """
foo(b, # type: int
a = 0, # type: float
):
# type: (...) -> str
"""
def dummy_handler(*args, **kwargs):
return "hello"
dynamic_fun = create_function(func_signature, dummy_handler)
assert dynamic_fun.__annotations__ == {'a': float, 'b': int, 'return': str}Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request