Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.albasani.net!feeder.erje.net!eu.feeder.erje.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed1a.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.006 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'argument': 0.05; 'subject:Python': 0.06; '(python': 0.07; 'annotations': 0.09; 'arguments': 0.09; 'pep': 0.09; 'cc:addr:python-list': 0.11; 'jan': 0.12; '*function': 0.16; '24,': 0.16; '3.0)': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; "function's": 0.16; 'optional': 0.16; 'rationale': 0.16; 'takes,': 0.16; 'url:peps': 0.16; 'sat,': 0.16; 'wrote:': 0.18; 'not,': 0.20; 'cc:addr:python.org': 0.22; 'url:dev': 0.24; 'cc:2**0': 0.24; 'header:In-Reply-To:1': 0.27; 'function': 0.29; 'am,': 0.29; 'message-id:@mail.gmail.com': 0.30; "i'm": 0.30; 'argue': 0.31; 'url:python': 0.33; 'totally': 0.33; 'could': 0.34; "can't": 0.35; 'case,': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'there': 0.35; 'really': 0.36; 'url:org': 0.36; 'fact': 0.38; 'that,': 0.38; 'expect': 0.39; 'does': 0.39; 'sure': 0.39; 'how': 0.40; 'is.': 0.60; 'then,': 0.60; 'tell': 0.60; 'introduced': 0.61; '2015': 0.84; 'subject:Solution': 0.84; 'notion': 0.91; 'subject:Proposal': 0.91; 'to:none': 0.92; 'anywhere,': 0.93 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type; bh=UoBIP+mTYQ/KeG7360KuaUcxfkLg3VOWHqUbJVAVe+8=; b=voMdfySfE+OBsTsDf4FcbXdp6u1b0dB42b61nRZVv4+nbcSFtRnzkZ/0XccqZHNg5A QIFyUnN8CalEbzY27+pZ2X5M2rw9OQDC0BRMDmOmbjMsfR6N7ziVYggr5bSgRsOtBlKl Gmw3npQjyJWrTv6NKeWyq/6Z1ObnxdxZQdzhRgVvPeXeTZk2VVsu7FBfr2WqiXy/brn3 wFdGB+jzQOFUUU7+rGq8dk8jDMtcWEUMlS5zyDPcX9BvP1LWolReA6IK5FnruLOkKfsw k2PK+qFgDdpaSQ4jy+z4Mzth7xKUl6M+1rHnNBXHzIIHOovgRnkgp4B8715Qahuk4xHS ZJgA== MIME-Version: 1.0 X-Received: by 10.224.46.132 with SMTP id j4mr6255443qaf.16.1422033078251; Fri, 23 Jan 2015 09:11:18 -0800 (PST) In-Reply-To: References: <6da1eb58-a0bb-4d37-8293-0a8cafe6a89c@googlegroups.com> <54c1e349$0$12975$c3e8da3$5496439d@news.astraweb.com> Date: Sat, 24 Jan 2015 04:11:18 +1100 Subject: Re: Python Sanity Proposal: Type Hinting Solution From: Chris Angelico Cc: "python-list@python.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 30 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1422033086 news.xs4all.nl 2924 [2001:888:2000:d::a6]:57414 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:84359 On Sat, Jan 24, 2015 at 12:23 AM, Fetchinson . wrote: > In any case, I'm pretty sure it was said before, but I can't really > find it anywhere, can someone tell me what the rationale is for > *function signature* type hinting? > > I totally get type hinting in general, but why does it have to be in > the function signature? Any reason for that specifically? Is there any particular reason for the number of arguments to be part of the function signature? I totally get the notion of declaring how many arguments a function takes, but why does it have to be in the function signature? Data types are just as much a part of that signature as argument count is. You could argue that the function's return type isn't part of that, but that's about it. > If there is a pep for it, people will use it, so the fact that > it is optional is irrelevant... Function annotations were introduced in 2006 (Python 3.0) with PEP 3107: https://www.python.org/dev/peps/pep-3107/ They were optional then, they are still optional now. Have you been overrun with them for the past decade? If not, why do you expect now to be? ChrisA