A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/python/typing/issues/276 below:

Allow Ellipsis as annotation for inferred type · Issue #276 · python/typing · GitHub

PEP 484 says that if an annotation is missing then the type assumed to be Any

def f(x) -> None:
    reveal_type(x) # Revealed type is 'Any'
def g(x: int):
    pass
reveal_type(g(1)) # Revealed type is 'Any'

However, it is not clear how to say to type checker that it should infer a missing type, rather than assume that it is Any. It was proposed by @ncoghlan to use Ellipsis for this purpose:

def f(x: ...) -> None:
    ...
def g(x: int) -> ...:
    ...

I am opening this issue, so that this idea will not be forgotten.

valtron, Naddiseo, maxfischer2781, strokirk, evhub and 2 more


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4