Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed4a.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.016 X-Spam-Evidence: '*H*': 0.97; '*S*': 0.00; 'python,': 0.02; 'received:67.192': 0.09; 'received:67.192.241': 0.09; 'received:dfw.emailsrvr.com': 0.09; 'python': 0.11; 'assumptions': 0.16; 'bugs.': 0.16; 'subject:type': 0.16; 'subject:python': 0.16; 'wrote:': 0.18; "python's": 0.19; 'code,': 0.22; 'header:User- Agent:1': 0.23; 'features,': 0.24; 'received:emailsrvr.com': 0.24; 'question': 0.24; 'received:(smtp server)': 0.26; 'header:In- Reply-To:1': 0.27; 'testing': 0.29; 'am,': 0.29; 'nature': 0.30; 'code': 0.31; 'easier': 0.31; 'lines': 0.31; 'gary': 0.31; 'allows': 0.31; 'worked': 0.33; 'bugs': 0.33; 'programmers': 0.33; 'problem': 0.35; 'but': 0.35; 'subject:data': 0.36; 'thank': 0.38; 'to:addr:python-list': 0.38; 'to:addr:python.org': 0.39; 'around.': 0.60; 'you.': 0.62; 'strategy': 0.64; 'here': 0.66; 'sam': 0.68; 'caused': 0.69; 'fact,': 0.69; 'subject:Best': 0.91 X-Virus-Scanned: OK Date: Fri, 14 Feb 2014 09:09:18 -0800 From: Gary Herron User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 MIME-Version: 1.0 To: python-list@python.org Subject: Re: Best practices to overcome python's dynamic data type nature References: <5fd7e804-820e-4fe1-b36b-67e553f3aedf@googlegroups.com> In-Reply-To: <5fd7e804-820e-4fe1-b36b-67e553f3aedf@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: 14 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1392398199 news.xs4all.nl 2893 [2001:888:2000:d::a6]:54576 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:66307 On 02/14/2014 08:10 AM, Sam wrote: > Dynamic data type has pros and cons. It is easier to program but also easier to create bugs. What are the best practices to reduce bugs caused by Python's dynamic data-type characteristic? Can the experienced Python programmers here advise? > > Thank you. The assumptions in that question are misleading. In fact, Python, with it's dynamic nature and other features, allows me to write fewer lines of code with fewer bugs-per-line. That's a win-win situation, not a problem which needs to be worked around. Still, when bugs do creep into code, the best strategy to find them is a good testing strategy. Gary Herron