Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.007 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; 'url:github': 0.09; 'jan': 0.12; '*function': 0.16; '24,': 0.16; '3.0)': 0.16; "function's": 0.16; 'luckily,': 0.16; 'means.': 0.16; 'optional': 0.16; 'rationale': 0.16; 'takes,': 0.16; 'url:issues': 0.16; 'url:peps': 0.16; 'sat,': 0.16; 'wrote:': 0.18; 'not,': 0.20; 'url:dev': 0.24; 'question': 0.24; 'header:In-Reply-To:1': 0.27; 'function': 0.29; 'chris': 0.29; 'am,': 0.29; 'message-id:@mail.gmail.com': 0.30; "i'm": 0.30; 'url:mailman': 0.30; 'argue': 0.31; 'there.': 0.32; 'url:python': 0.33; 'guess': 0.33; 'totally': 0.33; 'could': 0.34; 'problem': 0.35; "can't": 0.35; 'case,': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'there': 0.35; 'really': 0.36; 'proposals': 0.36; 'url:listinfo': 0.36; 'url:org': 0.36; 'from:addr:googlemail.com': 0.38; 'to:addr:python-list': 0.38; 'fact': 0.38; 'that,': 0.38; 'expect': 0.39; 'does': 0.39; 'sure': 0.39; 'to:addr:python.org': 0.39; 'url:mail': 0.40; 'how': 0.40; 'is.': 0.60; 'solve': 0.60; 'then,': 0.60; 'tell': 0.60; 'introduced': 0.61; 'soon': 0.63; '2015': 0.84; 'subject:Solution': 0.84; 'notion': 0.91; 'subject:Proposal': 0.91; 'anywhere,': 0.93 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=uVVWpr7Kn7f8enwKvIHigkFqP4ycDHG1ghLgoT9sf/s=; b=HHfIrUdo71VDmwKUp+uZ4gut4QmMURjAsk64txlHnJO/bN7TbxJIYwbh6M4V5kzCMW +27g4BayVJGYoVQX2FHJU9fa80lIKawShNiyV4wL3PqPFCRqmzP9ec7D+aPQ6lSCSfTh bFDqsdUJ2bIi8f/nA//HnBtfYbJ/fg6RkDXkALeAQ4Ts91Xxhk3YmYMWLQubgNvIzlmw EWQ4rwKNZM5RLNHPp2veZzJdjNJS/Hx9fWmVy8sQLUQT/4IEmc6bhZAZ684Gi6hTkmFt l//rh82TiucQE82C7g/zpgg50dhClAu1suqHc2f2UwFqkHGzMmaSEgkWlghU920P26wi jWwA== MIME-Version: 1.0 X-Received: by 10.229.1.72 with SMTP id 8mr16988627qce.25.1422047277257; Fri, 23 Jan 2015 13:07:57 -0800 (PST) In-Reply-To: References: <6da1eb58-a0bb-4d37-8293-0a8cafe6a89c@googlegroups.com> <54c1e349$0$12975$c3e8da3$5496439d@news.astraweb.com> Date: Fri, 23 Jan 2015 22:07:57 +0100 Subject: Re: Python Sanity Proposal: Type Hinting Solution From: "Fetchinson ." To: python-list@python.org Content-Type: text/plain; charset=ISO-8859-1 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: 55 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1422047285 news.xs4all.nl 2873 [2001:888:2000:d::a6]:58887 X-Complaints-To: abuse@xs4all.nl Path: csiph.com!usenet.pasdenom.info!bete-des-vosges.org!feed.ac-versailles.fr!nerim.net!novso.com!newsfeed.xs4all.nl!newsfeed2a.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Xref: csiph.com comp.lang.python:84402 On 1/23/15, Chris Angelico wrote: > 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 guess this is a rhetorical question :) > I totally get the notion of declaring how > many arguments a function takes, but why does it have to be in the > function signature? Ditto :) > Data types are just as much a part of that signature as argument count > is. I guess this would be true if there weren't about 5 other alternative proposals which solve the exact same problem (type hinting) by other means. Luckily, these will be listed in the PEP soon and the reason for rejecting them will be there as well, and so my question will pretty much be answered there. https://github.com/ambv/typehinting/issues/55 > 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 > -- > https://mail.python.org/mailman/listinfo/python-list > -- Psss, psss, put it down! - http://www.cafepress.com/putitdown