Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed1.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.002 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'python.': 0.02; 'static': 0.04; 'syntax': 0.04; 'represents': 0.05; 'subject:Python': 0.06; 'dynamically': 0.07; 'annotations': 0.09; 'arguments': 0.09; 'decorator': 0.09; 'executable': 0.09; 'integral': 0.09; 'pep': 0.09; 'runtime': 0.09; 'python': 0.11; 'def': 0.12; 'jan': 0.12; 'assume': 0.14; 'annotations.': 0.16; 'binary,': 0.16; 'overloaded': 0.16; 'runtime.': 0.16; 'says...': 0.16; 'syntax,': 0.16; 'unnecessary.': 0.16; 'language': 0.16; 'wrote:': 0.18; 'code.': 0.18; 'library': 0.18; 'slightly': 0.19; 'thu,': 0.19; 'meant': 0.20; 'example': 0.22; 'programming': 0.22; 'load': 0.23; "aren't": 0.24; 'stopping': 0.24; 'compiled': 0.26; 'long,': 0.26; 'suggested': 0.26; 'pass': 0.26; 'header:In-Reply-To:1': 0.27; 'function': 0.29; 'feature': 0.29; 'am,': 0.29; 'message- id:@mail.gmail.com': 0.30; 'that.': 0.31; 'argue': 0.31; 'context,': 0.31; 'yes.': 0.31; 'anyone': 0.31; 'there.': 0.32; 'languages': 0.32; 'themselves': 0.32; "we're": 0.32; 'another': 0.32; 'open': 0.33; 'up.': 0.33; 'proceed': 0.33; 'sense': 0.34; 'could': 0.34; 'something': 0.35; 'received:google.com': 0.35; 'there': 0.35; 'doing': 0.36; 'similar': 0.36; 'basis.': 0.38; 'to:addr:python-list': 0.38; 'does': 0.39; 'to:addr:python.org': 0.39; 'enough': 0.39; 'even': 0.60; 'discuss': 0.62; 'information': 0.63; 'myself': 0.63; 'different': 0.65; 'talking': 0.65; 'between': 0.67; 'containing': 0.69; 'fact,': 0.69; 'subject:! ': 0.74; 'obvious': 0.74; 'analysis': 0.75; 'article': 0.77; '2015': 0.84; 'confusing': 0.84; 'different.': 0.84; 'double,': 0.84; 'ian,': 0.84; 'julia': 0.84; 'obvious.': 0.84; 'scala': 0.84; 'absolutely': 0.87; 'examine': 0.93; 'hand,': 0.93 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=fR4yKtIeqdtB8zinqyiLynoqNS/IvZ2Dhdj9s/hh4aU=; b=Bxem8LW7TPkhBlkgEURvBiIH0/0o3n/6eu5kVXFThm74VaNhZGY1CFtCXk2CnVyzZU uhp3GWIdtd2KnzpqcGUVQ9cIdHqhwDOAxqRgcRoeRl2XfwFjzEKU4aqUB7/Fk9lZP150 aXsfhDIFt1X1zu0GxoU5DOtzWQ2FeDl79W+53r52t6eGd+ohVNDH9pH/cGteyoYJQMns H5lqvetpLHhMWDZFhmsh3JPo0GXbWyHXRfOyYrfBpNH58mJ2kloPcwdsEE75OhbKma24 D4IzHomB/9qHOPn2ZVeRvqOJZXfxakKvcd9Cg3+zIamcylTD/yVKIGZ27TCVLeNAjibO sY3A== X-Received: by 10.66.148.161 with SMTP id tt1mr1849653pab.85.1422549043428; Thu, 29 Jan 2015 08:30:43 -0800 (PST) MIME-Version: 1.0 In-Reply-To: References: <54c07d04$0$13012$c3e8da3$5496439d@news.astraweb.com> <1939680766443642112.878725sturla.molden-gmail.com@news.gmane.org> <6eb91c4b-92ff-44a8-b5a9-6ef04c71f4cb@googlegroups.com> <35a40ec6-3763-448b-9ea4-4a233a04979b@googlegroups.com> <54c1ccc8$0$13005$c3e8da3$5496439d@news.astraweb.com> <54c6d7c2$0$12992$c3e8da3$5496439d@news.astraweb.com> <54c83ab4$0$12982$c3e8da3$5496439d@news.astraweb.com> <54c980cd$0$12981$c3e8da3$5496439d@news.astraweb.com> From: Ian Kelly Date: Thu, 29 Jan 2015 09:30:02 -0700 Subject: Re: Python is DOOMED! Again! To: Python 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: 51 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1422549052 news.xs4all.nl 2913 [2001:888:2000:d::a6]:45767 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:84823 On Thu, Jan 29, 2015 at 1:34 AM, Mario Figueiredo wrote: > In article <54c980cd$0$12981$c3e8da3$5496439d@news.astraweb.com>, > steve+comp.lang.python@pearwood.info says... >> >> Ian, that's obvious. Just open your eyes: >> >> Scala >> def addInt( a:Int, b:Int ) : Int >> >> Python >> def addInt( a:int, b:int ) -> int: >> >> >> They're COMPLETELY different. In Scala they are *type declarations*, not >> annotations. We're talking about annotations, not declarations. They're as >> different as cheese and a very slightly different cheese. Do try to keep >> up. >> >> *wink* > > The sarcasm is unnecessary. They are different yes. Are you on purpose > confusing the syntax of a feature with its meaning? Because while you > have a very similar syntax between Julia, Scala and Python. Their > meanings are very different. > > I think it is obvious to anyone that if a feature like type annotations > are meant to be EVALUATED AT RUNTIME (and I myself gave you another > example of Julia), it makes every sense for that feature to be a part of > the programming language syntax. I could never argue against Julia or > Scala type annotations on that basis. The syntax is an integral part of > the executable code. Okay, I don't know enough about Scala's type system to discuss that example in this context, so I won't try to. Let's instead focus on another of the languages you listed: C. C includes types in its syntax, which it uses for static analysis at compile time. At runtime, it uses them for ... nothing. In fact, if you examine a compiled C binary, you won't even find any type information in there. If you dynamically load a C library containing a function that takes a double, and you pass it a long, it won't even blink. It will just assume that the data it received represents a double and proceed from there. Now with PEP 484 type annotations on the other hand, while the suggested static analysis tools aren't used at runtime, the annotations themselves are available to be evaluated at runtime. If you want to write a decorator that examines the types of the arguments of the function it decorates and does something nifty with them (automatic registration of overloaded functions using PEP 443 generics, perhaps), there is absolutely nothing stopping you from doing that.