Skip to content

About formal parameter is function, how to hint it? #1131

@HouLingLXH

Description

@HouLingLXH

For example:

def test(a: int, b:???):
print(b(a))

def add( x:int):
return x + 1

test(1, add)

About the ??? after b, how to hint the type of b is "(x:int) -> int" ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    topic: featureDiscussions about new features for Python's type annotations

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions