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


Groups > comp.lang.python > #79896

Re: What for -- for? (was A bug?)

Path csiph.com!usenet.pasdenom.info!aioe.org!newsfeed1.swip.net!uio.no!news.tele.dk!news.tele.dk!small.news.tele.dk!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <zachary.ware@gmail.com>
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; 'exercise': 0.04; 'one?': 0.05; 'subject: -- ': 0.07; 'subject:bug': 0.07; 'wednesday,': 0.07; 'optimizing': 0.09; 'spec': 0.09; 'def': 0.12; 'fuzzy': 0.16; 'loops': 0.16; 'subject:?)': 0.16; 'so.': 0.16; 'sender:addr:gmail.com': 0.17; 'wrote:': 0.18; 'wed,': 0.18; 'bit': 0.19; 'to:name:python-list@python.org': 0.22; 'header:In- Reply-To:1': 0.27; 'am,': 0.29; 'compared': 0.30; 'message- id:@mail.gmail.com': 0.30; 'class': 0.32; 'but': 0.35; 'received:google.com': 0.35; 'there': 0.35; 'two': 0.37; 'depends': 0.38; 'skip:[ 10': 0.38; 'to:addr:python-list': 0.38; 'short': 0.38; 'itself': 0.39; 'to:addr:python.org': 0.39; 'first': 0.61; 'such': 0.63; 'map': 0.64; 'abc': 0.84; 'toy': 0.84; 'ware': 0.91
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:content-type; bh=BicN1xhJR4yOYz7nl+gaA4VQvt0CjYRIFI+b6856x7A=; b=mxHbj5t7ur0hyY2lD3Qgn5NV7xHKf4i7Nz0qgQRhTrgPyuA4QIebYJziAAQawmSPYv 267rQUxIOJ5dw41kr43k+kLnDimbUtJ+2/99qqNiUs9+5k0r6GjHznKa8Hx7OWVF7tLS HMFfPjo6KmE0N3hN9LPx3M0CAsymyZ+eE3/3lX2sMcQ7dDBmYSfjmdVEkucR8uGA0Jhr nYdMMbmLjsypsKIwaeNj/7cX9H7mWGIINqDMTSf0JCIHcleK+zyhG4NQpBv4NEkJmZi5 /EvNU9Ew4uPijKMAllA4xWzoon5vjFg9fUecB0mFmhKrRU1j6plVRjfC9bQlnDB6xMf8 RkOg==
X-Received by 10.182.98.168 with SMTP id ej8mr7014501obb.41.1414563552724; Tue, 28 Oct 2014 23:19:12 -0700 (PDT)
MIME-Version 1.0
Sender zachary.ware@gmail.com
In-Reply-To <525eb5e7-c221-4336-8c9a-aafb4c545f51@googlegroups.com>
References <f491d969-7405-4017-b9c4-e1cb52a70280@googlegroups.com> <m2mof5$hvh$2@dont-email.me> <mailman.15248.1414459811.18130.python-list@python.org> <m2pinn$hum$2@dont-email.me> <94e3143a-c9ab-433d-8b3d-6ab296de14d9@googlegroups.com> <CAKJDb-PEj4UWpFFTvJN_gh-AOTHJwS0D7+_WUdeLkWyQ-KsQVg@mail.gmail.com> <mailman.15282.1414556609.18130.python-list@python.org> <593c0099-770f-48cd-b7ba-22154b00f130@googlegroups.com> <mailman.15283.1414558776.18130.python-list@python.org> <ed95d533-c4db-4081-bd32-61a93aaf797c@googlegroups.com> <mailman.15285.1414561194.18130.python-list@python.org> <525eb5e7-c221-4336-8c9a-aafb4c545f51@googlegroups.com>
From Zachary Ware <zachary.ware+pylist@gmail.com>
Date Wed, 29 Oct 2014 01:18:52 -0500
X-Google-Sender-Auth ufdhEjqeSylRoebDf2Ili-TZemM
Subject Re: What for -- for? (was A bug?)
To "python-list@python.org" <python-list@python.org>
Content-Type text/plain; charset=UTF-8
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 <https://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 <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.15288.1414563555.18130.python-list@python.org> (permalink)
Lines 22
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1414563555 news.xs4all.nl 2835 [2001:888:2000:d::a6]:47023
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:79896

Show key headers only | View raw


On Wed, Oct 29, 2014 at 1:11 AM, Rustom Mody <rustompmody@gmail.com> wrote:
> On Wednesday, October 29, 2014 11:10:06 AM UTC+5:30, Zachary Ware wrote:
>> Of course, that's 3 (progressively shorter) loops to get the names of
>> the ABCs of a class compared to 1 (fairly short in the first place)
>> loop for a map of relationships to all available ABCs, but optimizing
>> such a toy as this would just be an exercise in futility :)
>
> Not so.
>
> The charm of introspection is that the introspection
> itself can be introspected.
> For that to be convincing there needs to be a good combo
> of clarity and succinctness.  In particular why not reduce
> the two functions to one?
>
> def get_abc_names(cls):
>     return [abc.__name__ for abc in abcs if issubclass(cls,abc)]

Well, it depends on what you actually want, the spec has been a bit fuzzy ;)

-- 
Zach

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


Thread

A bug? "umatrp@gmail.com" <trsexgl@gmail.com> - 2014-10-27 09:01 -0700
  Re: A bug? Wolfgang Maier <wolfgang.maier@biologie.uni-freiburg.de> - 2014-10-27 17:17 +0100
  Re: A bug? Ian Kelly <ian.g.kelly@gmail.com> - 2014-10-27 10:26 -0600
  Re: A bug? Denis McMahon <denismfmcmahon@gmail.com> - 2014-10-28 00:36 +0000
    Re: A bug? Rustom Mody <rustompmody@gmail.com> - 2014-10-27 18:12 -0700
      Re: A bug? Chris Angelico <rosuav@gmail.com> - 2014-10-28 12:25 +1100
        Re: A bug? Rustom Mody <rustompmody@gmail.com> - 2014-10-27 19:13 -0700
    Re: A bug? Joshua Landau <joshua@landau.ws> - 2014-10-28 01:29 +0000
      Re: A bug? Denis McMahon <denismfmcmahon@gmail.com> - 2014-10-29 02:17 +0000
        What for -- for?  (was A bug?) Rustom Mody <rustompmody@gmail.com> - 2014-10-28 20:22 -0700
          Re: What for -- for? (was A bug?) Zachary Ware <zachary.ware+pylist@gmail.com> - 2014-10-28 23:16 -0500
          Re: What for -- for? (was A bug?) Zachary Ware <zachary.ware+pylist@gmail.com> - 2014-10-28 23:23 -0500
            Re: What for -- for? (was A bug?) Rustom Mody <rustompmody@gmail.com> - 2014-10-28 21:40 -0700
              Re: What for -- for? (was A bug?) Zachary Ware <zachary.ware+pylist@gmail.com> - 2014-10-28 23:59 -0500
                Re: What for -- for? (was A bug?) Rustom Mody <rustompmody@gmail.com> - 2014-10-28 22:15 -0700
                Re: What for -- for? (was A bug?) Zachary Ware <zachary.ware+pylist@gmail.com> - 2014-10-29 00:39 -0500
                Re: What for -- for? (was A bug?) Rustom Mody <rustompmody@gmail.com> - 2014-10-28 23:11 -0700
                Re: What for -- for? (was A bug?) Zachary Ware <zachary.ware+pylist@gmail.com> - 2014-10-29 01:18 -0500
                Finding way around ABCs (was What for -- for? (was A bug?)) Rustom Mody <rustompmody@gmail.com> - 2014-10-30 10:01 -0700
                Re: Finding way around ABCs (was What for -- for? (was A bug?)) Ian Kelly <ian.g.kelly@gmail.com> - 2014-10-30 11:09 -0600
                Re: Finding way around ABCs (was What for -- for? (was A bug?)) Rustom Mody <rustompmody@gmail.com> - 2014-10-30 10:16 -0700
                Re: Finding way around ABCs (was What for -- for? (was A bug?)) Ian Kelly <ian.g.kelly@gmail.com> - 2014-10-30 11:11 -0600
          Re: What for -- for? (was A bug?) Ben Finney <ben+python@benfinney.id.au> - 2014-10-29 16:27 +1100
          Re: What for -- for? (was A bug?) Zachary Ware <zachary.ware+pylist@gmail.com> - 2014-10-29 00:42 -0500
            Re: What for -- for? (was A bug?) Rustom Mody <rustompmody@gmail.com> - 2014-10-28 22:57 -0700
          Re: What for -- for? (was A bug?) Ben Finney <ben+python@benfinney.id.au> - 2014-10-29 17:02 +1100
          Re: What for -- for? (was A bug?) Joshua Landau <joshua@landau.ws> - 2014-10-30 17:21 +0000
            Re: What for -- for? (was A bug?) Rustom Mody <rustompmody@gmail.com> - 2014-10-30 10:41 -0700

csiph-web