Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.freenet.ag!news2.euro.net!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; 'python,': 0.02; 'output': 0.04; 'subject:Python': 0.05; 'read-only': 0.07; 'sequences.': 0.07; "'''": 0.09; 'methods,': 0.09; 'mutable': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'terry': 0.09; 'agree.': 0.16; 'iterable,': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'reedy': 0.16; 'roy': 0.16; 'wrote:': 0.17; 'jan': 0.18; '>>>': 0.18; 'import': 0.21; 'doc': 0.22; 'subject:Questions': 0.22; 'tuples': 0.22; 'header:In-Reply- To:1': 0.25; 'header:User-Agent:1': 0.26; 'wrote': 0.26; 'common': 0.26; 'am,': 0.27; '(we': 0.27; 'header:X-Complaints-To:1': 0.28; 'rest': 0.28; 'container': 0.29; 'index,': 0.29; 'methods.': 0.29; 'skip:_ 10': 0.29; 'class': 0.29; 'that.': 0.30; 'sense': 0.31; 'lists': 0.31; '(and': 0.32; 'getting': 0.33; 'to:addr:python- list': 0.33; 'produced': 0.33; 'requirements': 0.33; 'filter': 0.35; 'sequence': 0.35; 'something': 0.35; 'received:org': 0.36; 'tool': 0.36; 'enough': 0.36; 'does': 0.37; 'subject:: ': 0.38; 'files': 0.38; 'to:addr:python.org': 0.39; 'little': 0.39; 'header:Received:5': 0.40; 'most': 0.61; 'production': 0.63; 'different': 0.63; 'more': 0.63; 'today,': 0.64; 'our': 0.65; 'therefore': 0.65; 'today.': 0.69; 'smith': 0.71; 'received:fios.verizon.net': 0.84; 'subject:Interview': 0.84; 'conversation': 0.91 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Terry Reedy Subject: Re: Python Interview Questions Date: Mon, 19 Nov 2012 15:41:36 -0500 References: <1193768041.349129.26350@v3g2000hsg.googlegroups.com> <55443eb7-847c-4f4c-8d04-1e6b507aac00@googlegroups.com> <50a8acdc$0$29978$c3e8da3$5496439d@news.astraweb.com> <50a911ec$0$29978$c3e8da3$5496439d@news.astraweb.com> <50a97de0$0$29983$c3e8da3$5496439d@news.astraweb.com> <50a9e5cf$0$21863$c3e8da3$76491128@news.astraweb.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: pool-173-75-251-66.phlapa.fios.verizon.net User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:16.0) Gecko/20121026 Thunderbird/16.0.2 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: 32 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1353357720 news.xs4all.nl 6845 [2001:888:2000:d::a6]:60514 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:33552 On 11/19/2012 9:30 AM, Roy Smith wrote: > Our requirements are to scan the logs of a production site and filter > down the gobs and gobs of output (we produced 70 GB of log files > yesterday) into something small enough that a human can see what the > most common failures were. The tool I wrote does that. > > The rest of this conversation is just silly. It's turning into getting > hit on the head lessons. I agree. In early Python, tuples were more different from lists than they are today. They did not have any (public) methods. Today, they have .index and .count methods, which make little sense from the 'tuple is a record' viewpoint. The addition of those methods redefined tuples as read-only (and therefore hashable) sequences. From the collections.abc doc ''' Sequence | Sized, Iterable, Container | __getitem__ __contains__, __iter__, __reversed__, index, and count ... class collections.abc.Sequence class collections.abc.MutableSequence ABCs for read-only and mutable sequences. ''' >>> from collections.abc import Sequence >>> issubclass(tuple, Sequence) True -- Terry Jan Reedy