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


Groups > comp.lang.python > #33524

Re: Python Interview Questions

Path csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <rosuav@gmail.com>
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; 'syntax': 0.03; 'subject:Python': 0.05; 'grep': 0.09; 'immutable': 0.09; 'output,': 0.09; 'someone,': 0.09; 'sure,': 0.09; 'tuple': 0.09; '1:09': 0.16; 'color.': 0.16; 'egrep': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'highlight': 0.16; 'immutability': 0.16; 'record,': 0.16; 'roy': 0.16; 'theorist': 0.16; 'tuple,': 0.16; 'whatever,': 0.16; 'mon,': 0.16; 'wrote:': 0.17; 'appears': 0.18; 'received:209.85.214.174': 0.21; 'subject:Questions': 0.22; 'header:In-Reply-To:1': 0.25; 'first,': 0.27; 'message-id:@mail.gmail.com': 0.27; 'lines': 0.28; "i'm": 0.29; 'maybe': 0.29; 'function': 0.30; 'error': 0.30; 'point': 0.31; 'gets': 0.32; 'skip:- 10': 0.32; 'anywhere': 0.33; 'purposes,': 0.33; 'to:addr:python-list': 0.33; 'received:google.com': 0.34; 'filter': 0.35; 'nov': 0.35; 'pm,': 0.35; 'received:209.85': 0.35; 'tool': 0.36; 'but': 0.36; "i'll": 0.36; 'keeps': 0.37; 'maintaining': 0.37; 'quite': 0.37; 'received:209': 0.37; 'subject:: ': 0.38; 'some': 0.38; 'to:addr:python.org': 0.39; 'received:209.85.214': 0.39; 'header:Received:5': 0.40; 'red': 0.60; 'most': 0.61; 'different': 0.63; 'obvious': 0.71; 'smith': 0.71; 'inventor': 0.84; 'subject:Interview': 0.84
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=c4+PGhMmyEfStXdtWF1QErL6cFBhpf0uR3FvMjZ/MMA=; b=MH7f0XbfXDY/h1wF0jCFq6EJQpAiqUvmCUS3nFZEYWgJ7Vgt2X2mTaklW5lC+BQCw5 L9oFeF+7w3nLHZZqAk3rNMGovmSO7eUZNU34X3ieMcQDNYoCoEPZ/AfMewmkt9ZDWruo Vk3JK4B2SnIpMZ72PmGSYHmgGQUSlrcJ0Q7xO2r0XxG/9Q45Lc2FszKj52r1UjS5z92s qZpAeMWq+rnOAegGtyKNduXCU2XOb0syX0qdHiWPjEPtDXYuSuPFKPozEvkZmXxVgUsA fwpg3y7nDeCcFDZE9EeL8HwMjVyzFMPy/0uftQaeu1BdtToA/4I087FGpjCxnCIvmv0I oGkw==
MIME-Version 1.0
In-Reply-To <roy-BD53B0.21093618112012@news.panix.com>
References <1193768041.349129.26350@v3g2000hsg.googlegroups.com> <55443eb7-847c-4f4c-8d04-1e6b507aac00@googlegroups.com> <50a8acdc$0$29978$c3e8da3$5496439d@news.astraweb.com> <roy-EFE1F1.08532518112012@news.panix.com> <50a911ec$0$29978$c3e8da3$5496439d@news.astraweb.com> <roy-B2D5FF.12535018112012@news.panix.com> <50a97de0$0$29983$c3e8da3$5496439d@news.astraweb.com> <roy-BD53B0.21093618112012@news.panix.com>
Date Mon, 19 Nov 2012 13:18:18 +1100
Subject Re: Python Interview Questions
From Chris Angelico <rosuav@gmail.com>
To python-list@python.org
Content-Type text/plain; charset=ISO-8859-1
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.3802.1353291501.27098.python-list@python.org> (permalink)
Lines 24
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1353291501 news.xs4all.nl 6852 [2001:888:2000:d::a6]:39826
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:33524

Show key headers only | View raw


On Mon, Nov 19, 2012 at 1:09 PM, Roy Smith <roy@panix.com> wrote:
> The theorist understands that a chisel and a screwdriver were intended
> for different purposes, but the pragmatist gets the paint can open.

A good tool can always be used in ways its inventor never intended -
and it will function as its user expects.

$ some_program | egrep --color=always '(ERROR|^)'

will highlight the word ERROR in red anywhere it appears in the
program's output, while maintaining all other lines without color. Not
normal use of grep, to be sure, but quite functional.

A tuple may have been intended to be a record, a struct, whatever, but
it is what it is, and I'll use one any time it's the best tool for the
job. Maybe its immutability is critical; or maybe it's just the most
convenient syntax and all I care about is that it be iterable.

But when I'm explaining grep to someone, I'll describe it as a filter
that keeps only some lines from the original, and when I describe a
tuple, I'll point out that it's immutable and (potentially) hashable.
The obvious first, the unobvious later.

ChrisA

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