Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed1.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.022 X-Spam-Evidence: '*H*': 0.96; '*S*': 0.00; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'bug': 0.12; 'extraneous': 0.16; 'manifest': 0.16; 'message-id:@4ax.com': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'restricting': 0.16; 'code,': 0.22; 'aug': 0.22; 'error': 0.23; "aren't": 0.24; 'module,': 0.24; 'url:home': 0.24; 'header:X -Complaints-To:1': 0.27; 'point': 0.28; 'function': 0.29; 'raise': 0.29; 'code': 0.31; '+0100,': 0.31; 'block,': 0.31; 'level.': 0.33; 'problem': 0.35; 'module.': 0.36; 'charset:us-ascii': 0.36; 'subject:?': 0.36; 'too': 0.37; 'received:76': 0.38; 'problems': 0.38; 'handle': 0.38; 'to:addr:python-list': 0.38; 'anything': 0.39; 'itself': 0.39; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'users': 0.40; 'remove': 0.60; 'making': 0.63; 'spot': 0.65; 'invalid': 0.68; 'viable': 0.84; '2013': 0.98 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Dennis Lee Bieber Subject: Re: Newbie: static typing? Date: Tue, 06 Aug 2013 18:54:15 -0400 Organization: IISS Elusive Unicorn References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: adsl-76-253-102-34.dsl.klmzmi.sbcglobal.net X-Newsreader: Forte Agent 6.00/32.1186 X-No-Archive: YES 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: 19 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1375829664 news.xs4all.nl 15879 [2001:888:2000:d::a6]:34930 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:52077 On Tue, 06 Aug 2013 11:28:07 +0100, Rui Maciel declaimed the following: > >If the type problems aren't caught right away when the invalid types are >passed to a function then the problem may only manifest itself in some far >away point in the code, making this bug needlessly harder to spot and fix, >and making the whole ordeal needlessly too time consuming. > Then wrap your code with a try/except block, allowing you to report a misfunction at your level. That way anything that is viable can still work without you restricting users of your module, yet you can handle the failure, remove the extraneous (to you) low-level error trace, and raise a failure apropos to your module. -- Wulfraed Dennis Lee Bieber AF6VN wlfraed@ix.netcom.com HTTP://wlfraed.home.netcom.com/