Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!newsfeed.xs4all.nl!newsfeed5.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.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'python,': 0.02; 'url:pypi': 0.03; 'wiki': 0.03; 'compiler': 0.05; 'interpreted': 0.07; 'pypi': 0.07; 'testing,': 0.07; 'unittest': 0.07; 'python': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'runtime': 0.09; 'looked': 0.10; "wouldn't": 0.11; ':-)': 0.13; 'language': 0.14; "'user'": 0.16; 'compares': 0.16; 'debug)': 0.16; 'input.': 0.16; 'message-id:@dough.gmane.org': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'roy': 0.16; 'still,': 0.16; 'wrote:': 0.17; 'variables': 0.17; '>>>': 0.18; 'module': 0.19; 'do.': 0.21; 'java': 0.21; 'programming': 0.23; 'errors': 0.23; 'testing': 0.24; 'header:In-Reply-To:1': 0.25; 'header:User- Agent:1': 0.26; 'leave': 0.26; 'checking': 0.27; 'separate': 0.27; 'library.': 0.27; "doesn't": 0.28; 'header:X-Complaints-To:1': 0.28; "i'm": 0.29; "skip:' 10": 0.30; 'that.': 0.30; 'waste': 0.30; 'sense': 0.31; 'code': 0.31; '(and': 0.32; 'url:python': 0.32; 'from:addr:yahoo.co.uk': 0.32; "aren't": 0.33; 'to:addr :python-list': 0.33; 'languages': 0.33; 'list': 0.35; 'there': 0.35; 'received:org': 0.36; 'really': 0.36; 'but': 0.36; 'wanted': 0.36; 'url:org': 0.36; 'modules': 0.36; "i'll": 0.36; 'enough': 0.36; 'possible': 0.37; 'why': 0.37; 'subject:: ': 0.38; 'mark': 0.38; 'easier': 0.38; 'some': 0.38; 'sure': 0.38; 'to:addr:python.org': 0.39; 'called': 0.39; 'google': 0.39; 'list,': 0.39; 'header:Received:5': 0.40; 'help': 0.40; 'easy': 0.60; 'real': 0.61; 'subject:, ': 0.61; 'strange': 0.62; 'truly': 0.62; 'making': 0.64; 'here': 0.65; 'smith': 0.71; 'sir,': 0.78; 'article,': 0.84; 'received:89': 0.86; 'kat': 0.91; 'dare': 0.93; 'subject:skip:E 10': 0.95 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Mark Lawrence Subject: Re: Encapsulation, inheritance and polymorphism Date: Tue, 17 Jul 2012 17:26:28 +0100 References: <3vnfd9-343.ln1@satorlaser.homedns.org> <-8SdnVrXGqie25jNnZ2dnUVZ7qKdnZ2d@bt.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: host-89-243-194-149.as13285.net User-Agent: Mozilla/5.0 (Windows NT 6.0; rv:13.0) Gecko/20120614 Thunderbird/13.0.1 In-Reply-To: X-Antivirus: avast! (VPS 120717-0, 17/07/2012), Outbound message X-Antivirus-Status: Clean X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 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: 52 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1342542344 news.xs4all.nl 6952 [2001:888:2000:d::a6]:46123 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:25508 On 17/07/2012 15:23, Lipska the Kat wrote: > On 17/07/12 14:52, Roy Smith wrote: >> In article<-8SdnVrXGqie25jNnZ2dnUVZ7qKdnZ2d@bt.com>, >> Lipska the Kat wrote: >> >>> I'm not used to using variables without declaring their type >> >> If you truly wanted to recreate this type-bondage style of programming >> in Python, it's easy enough to do. > > snip > > Well 'type-bondage' is a strange way of thinking about compile time type > checking and making code easier to read (and therefor debug) but > I'm not about to get into some religious war about declaring a variables > type. I'll just say that I prefer to devote testing efforts to the real > danger area which in my experience is 'user' input. Why waste time testing, I thought that the compiler looked after everything? :) But seriously you might want to look at the unittest module in the standard library. There's also a separate mailing list for Python testing and I'm sure there's a wiki that compares the available tesing tools. Google and ye shall find!!! > Clients look dimly on runtime errors however they occur and if I can > leave it to the compiler to check as much as possible then I'll take that. > > I do understand however that compiling an intepreted language doesn't > really make sense however i'm sure there are interpreted languages that > allow pre-execution type checking ... aren't there ? Oh yes, there's one > called Java :-) There are tools available to help here such as pylint, pychecker and pyflakes. For other modules check out pypi at http://pypi.python.org/pypi > > Still, I'm sure you're only kidding around with me :-) Kidding around on a Python mailing list, never, how dare you Sir, simply wouldn't be cricket :-) > > Lipska > -- Cheers. Mark Lawrence.