Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!feeds.phibee-telecom.net!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.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'from:addr:yahoo.co.uk': 0.04; 'subject:Python': 0.06; 'steve': 0.09; 'arrays': 0.09; 'code"': 0.09; 'contexts': 0.09; 'debugging.': 0.09; 'inserted': 0.09; 'lawrence': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'tismer': 0.09; 'python': 0.11; 'benjamin': 0.16; 'nan': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'language': 0.16; 'wrote:': 0.18; 'value.': 0.19; 'memory': 0.22; 'programming': 0.22; 'header :User-Agent:1': 0.23; 'error': 0.23; '(such': 0.24; "haven't": 0.24; 'second': 0.26; 'values': 0.27; 'header:X-Complaints-To:1': 0.27; 'header:In-Reply-To:1': 0.27; 'quickly': 0.29; 'subject:end': 0.31; 'values.': 0.31; 'supposed': 0.32; 'but': 0.35; 'useful': 0.36; 'christian': 0.38; 'expected': 0.38; 'to:addr:python-list': 0.38; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'skip:u 10': 0.60; 'range': 0.61; 'world.': 0.61; 'show': 0.63; 'kind': 0.63; 'more': 0.64; 'between': 0.67; 'results': 0.69; 'programs,': 0.74; 'distinguish': 0.84; 'oscar': 0.84; 'received:2': 0.84; 'mistake': 0.91 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Mark Lawrence Subject: Re: Python Front-end to GCC Date: Fri, 25 Oct 2013 04:40:30 +0100 References: <4012031f-5334-4be8-a673-e0d8c8917fb2@googlegroups.com> <5264dbbe$0$30000$c3e8da3$5496439d@news.astraweb.com> <5265bba8$0$29981$c3e8da3$5496439d@news.astraweb.com> <526668e5$0$29981$c3e8da3$5496439d@news.astraweb.com> <52669852$0$29981$c3e8da3$5496439d@news.astraweb.com> <5266aa80$0$29981$c3e8da3$5496439d@news.astraweb.com> <5266b496$0$29981$c3e8da3$5496439d@news.astraweb.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-2-98-201-160.as13285.net User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:24.0) Gecko/20100101 Thunderbird/24.0.1 In-Reply-To: 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: 24 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1382672447 news.xs4all.nl 15869 [2001:888:2000:d::a6]:34580 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:57492 On 22/10/2013 18:37, Oscar Benjamin wrote: > > OTOH why in particular would you want to initialise them with zeros? I > often initialise arrays to nan which is useful for debugging. It means > that you can see if you made a mistake when you were supposed to have > initialised everything to useful values. In many contexts it would be > difficult to distinguish between a valid zero and a zero because you > haven't yet inserted a value. This kind of error can show up more > quickly if you don't zero the memory since the uninitialised values > will often be out of range for what you expected and will give very > noticeable results (such as a seg-fault). > In his book "Writing Solid Code" Steve Maguire states that he initialises with 0xA3 for Macintosh programs, and that Microsoft uses 0xCC, for exactly the reasons that you describe above. -- Python is the second best programming language in the world. But the best has yet to be invented. Christian Tismer Mark Lawrence