Path: csiph.com!usenet.pasdenom.info!gegeweb.org!usenet-fr.net!nerim.net!novso.com!newsfeed.xs4all.nl!newsfeed2.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.003 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'static': 0.04; 'argument': 0.05; 'detect': 0.07; 'sure,': 0.09; 'bug': 0.12; 'language,': 0.12; '(when': 0.16; 'argument.': 0.16; 'attributes.': 0.16; 'burak': 0.16; 'declarations': 0.16; 'easier.': 0.16; 'expecting': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'irrespective': 0.16; 'operands': 0.16; 'runtime.': 0.16; 'wrote:': 0.18; 'trying': 0.19; 'passing': 0.19; 'typing': 0.19; 'later': 0.20; '>>>': 0.22; 'code,': 0.22; 'aug': 0.22; 'otherwise,': 0.22; "shouldn't": 0.24; 'initial': 0.24; 'regardless': 0.24; 'first,': 0.26; 'header:In-Reply-To:1': 0.27; 'function': 0.29; 'testing': 0.29; 'ease': 0.30; 'errors': 0.30; 'message-id:@mail.gmail.com': 0.30; 'code': 0.31; 'easier': 0.31; '>>>>': 0.31; 'exceptions': 0.31; 'interface': 0.32; 'actual': 0.34; 'problem': 0.35; "can't": 0.35; 'test': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'there': 0.35; 'words,': 0.36; 'subject:?': 0.36; 'hi,': 0.36; 'to:addr:python-list': 0.38; 'fact': 0.38; 'pm,': 0.38; 'rather': 0.38; 'that,': 0.38; 'does': 0.39; 'to:addr:python.org': 0.39; 'problems.': 0.60; "you're": 0.61; 'kind': 0.63; 'such': 0.63; 'production.': 0.68; 'given.': 0.84; 'pardon': 0.84; 'thrown,': 0.84; '2013': 0.98 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:to :content-type; bh=DxjQXVRe7LAZ18KHQO2QPm7++0CpVRbl8XMd2lzTIjY=; b=b5iUhxBtL7fulaMoeEVavtgif4j+PJ9r1QmqfQPIyGdM0KutPsAaBF2FyhKDfzD4K8 B+xLWQZG638iojy1JuPsBuQ+fJ5LLPnr3jHQV3a+MNEhMxd/jlpylZ58yK0Coib/jSVa vTOeUWj37dzLjEvQjBDYtEt0I7Y0HE37/6dmhqYLY0XjPjFdJLTnP+eQt1FOF78QPj66 ifr+TvWVtglLDV4JP2/K6Z2qUByUftepgTcJKfjKVzRLc7HyJ6Hbus9/rI0xFP7zjlxG PNXBSzcjOtTa9ifcx5diNC8aY2ANQB9+ZusWVs1q8BpAZ794UonbhsERIfGuNYgr77Zz jglg== MIME-Version: 1.0 X-Received: by 10.58.214.105 with SMTP id nz9mr405554vec.58.1375798000125; Tue, 06 Aug 2013 07:06:40 -0700 (PDT) In-Reply-To: <520100C6.30909@rece.vub.ac.be> References: <5200F9AE.9000805@arskom.com.tr> <520100C6.30909@rece.vub.ac.be> Date: Tue, 6 Aug 2013 15:06:40 +0100 Subject: Re: Newbie: static typing? From: Chris Angelico 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: 37 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1375798002 news.xs4all.nl 15918 [2001:888:2000:d::a6]:49255 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:52043 On Tue, Aug 6, 2013 at 2:57 PM, Antoon Pardon wrote: > Op 06-08-13 15:27, Burak Arslan schreef: >> On 08/06/13 13:12, Rui Maciel wrote: >>> Joshua Landau wrote: >>> >>>> What's the actual problem you're facing? Where do you feel that you >>>> need to verify types? >>> A standard case would be when there's a function which is designed expecting >>> that all operands support a specific interface or contain specific >>> attributes. >>> >>> In other words, when passing an unsupported type causes problems. >>> >> >> Hi, >> >> First, let's get over the fact that, with dynamic typing, code fails at >> runtime. Irrespective of language, you just shouldn't ship untested >> code, so I say that's not an argument against dynamic typing. > > Why not? Can ease of development not be a consideration? So if some > kind of faults are easier to detect at compile time if you have static > typing than if you have to design a test for them, I don't see why that > can't be an argument. Sure, which is why I like working in Pike, which does have static type declarations (when you want them; they can get out the way when you don't). But there will always be, regardless of your language, criteria that static typing cannot adequately handle, so just write your code to cope with exceptions - much easier. If the exception's never thrown, the bug can't be all that serious; otherwise, just deal with it when you find it, whether that be in initial testing or years later in production. There WILL BE such errors - that's a given. Deal with them, rather than trying to eliminate them. ChrisA