{"action":"created","issue":{"url":"https://api.github.com/repos/ambv/typehinting/issues/55","labels_url":"https://api.github.com/repos/ambv/typehinting/issues/55/labels{/name}","comments_url":"https://api.github.com/repos/ambv/typehinting/issues/55/comments","events_url":"https://api.github.com/repos/ambv/typehinting/issues/55/events","html_url":"https://github.com/ambv/typehinting/issues/55","id":55300794,"number":55,"title":"The PEP should list some rejected alternative syntaxes and explain why","user":{"login":"gvanrossum","id":2894642,"avatar_url":"https://avatars.githubusercontent.com/u/2894642?v=3","gravatar_id":"","url":"https://api.github.com/users/gvanrossum","html_url":"https://github.com/gvanrossum","followers_url":"https://api.github.com/users/gvanrossum/followers","following_url":"https://api.github.com/users/gvanrossum/following{/other_user}","gists_url":"https://api.github.com/users/gvanrossum/gists{/gist_id}","starred_url":"https://api.github.com/users/gvanrossum/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gvanrossum/subscriptions","organizations_url":"https://api.github.com/users/gvanrossum/orgs","repos_url":"https://api.github.com/users/gvanrossum/repos","events_url":"https://api.github.com/users/gvanrossum/events{/privacy}","received_events_url":"https://api.github.com/users/gvanrossum/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-01-23T16:22:30Z","updated_at":"2015-01-25T15:43:21Z","closed_at":null,"body":"On the list, Daniel Fetchinson wrote:\r\n\r\n\r\nIt looks like type hinting as a feature is applauded by everyone but\r\nthe actual syntax/implementation is polarizing. Could we have a\r\nsection in the PEP listing all alternative sytax/implementations with\r\npros and cons? Stuff like:\r\n\r\n1. Stub files\r\n\r\n\r\n2. property-style type hinting, e.g.:\r\n\r\n    @typehints( arg1: int, arg2: str, returns: str )\r\n    def func( arg1, arg2 )\r\n        return 'hello'\r\n\r\n\r\n3. docstrings, e.g.:\r\n\r\n    def func( arg1, arg2 ):\r\n        \"\"\"type hints: arg1: int, arg2: str, returns: str\"\"\"\r\n        return 'hello'\r\n\r\n4. Cobra-inspired type hints, e.g.:\r\n\r\n    def func( arg1, arg2 ):\r\n        requires:\r\n            isinstance( arg1, int )\r\n            isinstance( arg2, str )\r\n        returns:\r\n            str"},"comment":{"url":"https://api.github.com/repos/ambv/typehinting/issues/comments/71377902","html_url":"https://github.com/ambv/typehinting/issues/55#issuecomment-71377902","issue_url":"https://api.github.com/repos/ambv/typehinting/issues/55","id":71377902,"user":{"login":"fetchinson","id":1704054,"avatar_url":"https://avatars.githubusercontent.com/u/1704054?v=3","gravatar_id":"","url":"https://api.github.com/users/fetchinson","html_url":"https://github.com/fetchinson","followers_url":"https://api.github.com/users/fetchinson/followers","following_url":"https://api.github.com/users/fetchinson/following{/other_user}","gists_url":"https://api.github.com/users/fetchinson/gists{/gist_id}","starred_url":"https://api.github.com/users/fetchinson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fetchinson/subscriptions","organizations_url":"https://api.github.com/users/fetchinson/orgs","repos_url":"https://api.github.com/users/fetchinson/repos","events_url":"https://api.github.com/users/fetchinson/events{/privacy}","received_events_url":"https://api.github.com/users/fetchinson/received_events","type":"User","site_admin":false},"created_at":"2015-01-25T15:43:21Z","updated_at":"2015-01-25T15:43:21Z","body":"Yes, this would calm (most of) the opposition voices I think. The main concern is that while\r\n\r\ndef greeting(name: str) -> str:\r\n    return 'Hello ' + name\r\n\r\nlooks nice, intuitive and noise free, the whole thing can easily get out of hand by (example from the pep):\r\n\r\ndef async_query(on_success: Callable[[int], None], on_error: Callable[[int, Exception], None]):\r\n    .....\r\n\r\nand similar, which do look a bit noisy without the option to visually discard type hinting. \r\n\r\nAnother concern is that comments and doc strings were rejected as the avenue for type hinting but nevertheless the pep uses comment based info by the\r\n\r\n# type: ignore\r\n\r\nidiom. If type hinting shouldn't be in comments, why is it okay to have the above information in comments?"}}