A RetroSearch Logo

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

Search Query:

Showing content from https://github.com/ambv/typehinting/issues/55 below:

The PEP should list some rejected alternative syntaxes and explain why · Issue #55 · python/typing · GitHub

On the list, Daniel Fetchinson wrote:

It looks like type hinting as a feature is applauded by everyone but
the actual syntax/implementation is polarizing. Could we have a
section in the PEP listing all alternative sytax/implementations with
pros and cons? Stuff like:

  1. Stub files

  2. property-style type hinting, e.g.:

    @typehints( arg1: int, arg2: str, returns: str )
    def func( arg1, arg2 )
    return 'hello'

  3. docstrings, e.g.:

    def func( arg1, arg2 ):
    """type hints: arg1: int, arg2: str, returns: str"""
    return 'hello'

  4. Cobra-inspired type hints, e.g.:

    def func( arg1, arg2 ):
    requires:
    isinstance( arg1, int )
    isinstance( arg2, str )
    returns:
    str


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