Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed1a.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; 'url:bitbucket': 0.05; 'line:': 0.09; 'means,': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'sentence': 0.09; 'approaches.': 0.16; 'helps.': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'url:file': 0.16; 'url:ned': 0.16; 'url:py': 0.16; 'wrote:': 0.18; 'trying': 0.19; 'later': 0.20; 'written': 0.21; 'header:User-Agent:1': 0.23; 'bytes': 0.24; 'interpret': 0.24; 'received:comcast.net': 0.24; "i've": 0.25; 'header:X-Complaints-To:1': 0.27; 'header:In-Reply-To:1': 0.27; 'am,': 0.29; "i'm": 0.30; 'code': 0.31; 'that.': 0.31; 'url:python': 0.33; 'totally': 0.33; 'comment': 0.34; 'table': 0.34; 'there': 0.35; 'url:org': 0.36; 'to:addr:python-list': 0.38; 'explain': 0.39; 'sure': 0.39; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'how': 0.40; 'worry': 0.60; 'lost': 0.61; 'charset:iso-2022-jp': 0.65; 'reads': 0.68; 'url:cpython': 0.84; 'writing,': 0.84; '"how': 0.91 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Ned Batchelder Subject: Re: Understanding co_lnotab Date: Sat, 27 Sep 2014 08:08:58 -0400 References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-2022-JP Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: c-50-133-228-126.hsd1.ma.comcast.net User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 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: 36 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1411819753 news.xs4all.nl 2865 [2001:888:2000:d::a6]:48136 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:78413 On 9/26/14 7:13 AM, Shiyao Ma wrote: > When reading the notes on co_lnotab > > I totally got lost at this > line:https://hg.python.org/cpython/file/fd0c02c3df31/Objects/lnotab_notes.txt#l31 > > It says,"In case #b, there's no way to know > from looking at the table later how many were written." > > > No way to know "what" is written? > And why no way to know "how many" times? > I'm not sure what that sentence means, and I've written code that uses co_lnotab. I think they are trying to explain the difficulties with abandoned approaches. Don't worry about that. Look at the code in the comment there to see how to interpret the bytes in co_lnotab. Here's the code in coverage.py that reads it: https://bitbucket.org/ned/coveragepy/src/a69ae93817be94e400df257e1b1e41cf37c9b146/coverage/parser.py?at=default#cl-377 if that helps. Just out of curiosity, what are you writing, it sounds interesting! :) --Ned. > > Regards > > -- Ned Batchelder, http://nedbatchelder.com