Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #33552

Re: Python Interview Questions

From Terry Reedy <tjreedy@udel.edu>
Subject Re: Python Interview Questions
Date 2012-11-19 15:41 -0500
References (5 earlier) <roy-B2D5FF.12535018112012@news.panix.com> <50a97de0$0$29983$c3e8da3$5496439d@news.astraweb.com> <roy-BD53B0.21093618112012@news.panix.com> <50a9e5cf$0$21863$c3e8da3$76491128@news.astraweb.com> <roy-670C61.09305419112012@news.panix.com>
Newsgroups comp.lang.python
Message-ID <mailman.8.1353357720.29569.python-list@python.org> (permalink)

Show all headers | View raw


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

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: Python Interview Questions chinjannisha@gmail.com - 2012-11-17 10:01 -0800
  Re: Python Interview Questions Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2012-11-18 01:54 -0500
  Re: Python Interview Questions Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-11-18 09:39 +0000
    Re: Python Interview Questions Roy Smith <roy@panix.com> - 2012-11-18 08:53 -0500
      Re: Python Interview Questions Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-11-18 16:50 +0000
        Re: Python Interview Questions "D'Arcy J.M. Cain" <darcy@druid.net> - 2012-11-18 12:16 -0500
        Re: Python Interview Questions Roy Smith <roy@panix.com> - 2012-11-18 12:53 -0500
          Re: Python Interview Questions Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-11-19 00:31 +0000
            Re: Python Interview Questions Roy Smith <roy@panix.com> - 2012-11-18 21:09 -0500
              Re: Python Interview Questions Chris Angelico <rosuav@gmail.com> - 2012-11-19 13:18 +1100
              Re: Python Interview Questions Mark Lawrence <breamoreboy@yahoo.co.uk> - 2012-11-19 02:42 +0000
              Re: Python Interview Questions Ian Kelly <ian.g.kelly@gmail.com> - 2012-11-18 23:01 -0700
              Re: Python Interview Questions Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-11-19 07:54 +0000
                Re: Python Interview Questions Roy Smith <roy@panix.com> - 2012-11-19 09:30 -0500
                Re: Python Interview Questions Ian Kelly <ian.g.kelly@gmail.com> - 2012-11-19 09:44 -0700
                Re: Python Interview Questions Terry Reedy <tjreedy@udel.edu> - 2012-11-19 15:41 -0500
                Re: Python Interview Questions Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-11-19 23:42 +0000
                Re: Python Interview Questions Roy Smith <roy@panix.com> - 2012-11-19 21:33 -0500
                Re: Python Interview Questions Roy Smith <roy@panix.com> - 2012-11-19 09:59 -0500
                Re: Python Interview Questions Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-11-19 23:53 +0000
                Re: Python Interview Questions Roy Smith <roy@panix.com> - 2012-11-19 22:14 -0500
                RE: Python Interview Questions "Prasad, Ramit" <ramit.prasad@jpmorgan.com> - 2012-11-19 23:57 +0000
              Re: Python Interview Questions Terry Reedy <tjreedy@udel.edu> - 2012-11-19 03:27 -0500
        Re: Python Interview Questions Chris Angelico <rosuav@gmail.com> - 2012-11-19 07:02 +1100

csiph-web