Path: csiph.com!usenet.pasdenom.info!dedibox.gegeweb.org!gegeweb.eu!nntpfeed.proxad.net!proxad.net!feeder1-2.proxad.net!usenet-fr.net!nerim.net!novso.com!newsfeed.xs4all.nl!newsfeed2a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!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.005 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'static': 0.04; 'url:pipermail': 0.05; 'wednesday,': 0.07; 'annotations': 0.09; 'attributes': 0.09; 'editor.': 0.09; 'from:addr:ethan': 0.09; 'from:addr:stoneleaf.us': 0.09; 'from:name:ethan furman': 0.09; 'ide': 0.09; 'imho.': 0.09; 'message-id:@stoneleaf.us': 0.09; '~ethan~': 0.09; 'python': 0.11; 'language,': 0.12; 'libraries.': 0.16; 'optional': 0.16; 'folks': 0.16; 'language': 0.16; 'wrote:': 0.18; 'variable': 0.18; 'typing': 0.19; 'seems': 0.21; '>>>': 0.22; 'python?': 0.22; 'header:User-Agent:1': 0.23; 'asking': 0.27; 'header:In-Reply-To:1': 0.27; 'feature': 0.29; 'am,': 0.29; "doesn't": 0.30; 'returned': 0.30; 'especially': 0.30; "i'm": 0.30; "who'd": 0.31; 'there.': 0.32; 'url:python': 0.33; 'becomes': 0.33; 'could': 0.34; 'something': 0.35; 'editor': 0.35; 'but': 0.35; 'there': 0.35; 'object,': 0.36; "didn't": 0.36; 'useful': 0.36; 'similar': 0.36; 'url:org': 0.36; 'effort': 0.37; 'list': 0.37; 'to:addr:python-list': 0.38; 'to:addr:python.org': 0.39; 'called': 0.40; 'url:mail': 0.40; 'even': 0.60; 'skip:u 10': 0.60; 'introduced': 0.61; 'new': 0.61; 'received:173': 0.61; 'show': 0.63; 'information': 0.63; 'kind': 0.63; 'more': 0.64; 'useful.': 0.68; 'fact,': 0.69; 'lack': 0.78; 'dart': 0.84; 'official,': 0.84; 'otten': 0.84; 'pain': 0.84; 'you...': 0.96 Date: Wed, 29 Oct 2014 10:46:00 -0700 From: Ethan Furman User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:16.0) Gecko/20121010 Thunderbird/16.0.1 MIME-Version: 1.0 To: python-list@python.org Subject: Re: optional types References: <99399d4a-902d-42d9-86c8-7bdcd2a766cc@googlegroups.com> <18fa60be-225e-422d-82de-902c4a0c66da@googlegroups.com> In-Reply-To: <18fa60be-225e-422d-82de-902c4a0c66da@googlegroups.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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: 36 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1414604765 news.xs4all.nl 2884 [2001:888:2000:d::a6]:44200 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:79927 On 10/29/2014 10:18 AM, Kiuhnm wrote: > On Wednesday, October 29, 2014 5:57:13 PM UTC+1, Peter Otten wrote: >> Kiuhnm wrote: >> >>> I must say that the lack of static types in Python is a pain in the neck >>> especially when I'm exploring new libraries. Recently, I learned a new >>> language called Dart which have optional typing and I had a lot of fun >>> with it. Basically, you use type annotations as documentation and to give >>> useful information to the IDE or editor. That makes the IDE look *very* >>> smart! I'm using PyCharm and more often than not I want to see the list of >>> methods and attributes of an object, but the editor won't show them to me >>> because it doesn't know the dynamic type of the variable whose value was >>> just returned by a function. That's irritating! Am I the only one who'd >>> like to see optional types introduced in Python? >> >> Personally I am skeptical, but there is an effort underway: >> >> http://www.mypy-lang.org/ >> https://mail.python.org/pipermail/python-ideas/2014-August/028742.html >> >> Nothing that your search engine of choice could not have found you... > > In fact, I did find it, but that didn't stop me from asking :) > > You can find something similar for almost any dynamic language out there. > If it isn't an official feature of the language, it's useless, IMHO. > > It seems that PyCharm supports some kind of type annotations: > http://www.jetbrains.com/pycharm/webhelp/using-docstrings-to-specify-types.html > Unfortunately, again, if almost no one uses them, they're not very useful. Even if it becomes official, which seems likely, it will still be optional -- hence, only useful if folks actually use it. ;) -- ~Ethan~