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


Groups > comp.lang.python > #110635

Re: __all__ attribute: bug and proposal

Path csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail
From Random832 <random832@fastmail.com>
Newsgroups comp.lang.python
Subject Re: __all__ attribute: bug and proposal
Date Mon, 27 Jun 2016 22:27:21 -0400
Lines 8
Message-ID <mailman.56.1467080844.2358.python-list@python.org> (permalink)
References <d5e97a5e-6f10-4e3f-ab24-113632f16f29@googlegroups.com> <CAPTjJmqLmg5tPhLnvpMOg_+NhYiNOZW_RG2yDbBiqD6MYqtxSg@mail.gmail.com> <1467080841.3696367.650352489.04478540@webmail.messagingengine.com>
Mime-Version 1.0
Content-Type text/plain
Content-Transfer-Encoding 7bit
X-Trace news.uni-berlin.de AQ57SeDbv3UdrOqeZSh1lAITQAvQ3FO+N3SkU7fv0i7g==
Return-Path <random832@fastmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.002
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'subject:bug': 0.05; '__all__': 0.09; 'received:internal': 0.09; 'str)': 0.09; 'message-id:@webmail.messagingengine.com': 0.16; 'received:10.202': 0.16; 'received:10.202.2': 0.16; 'received:10.202.2.212': 0.16; 'received:66.111': 0.16; 'received:66.111.4': 0.16; 'received:66.111.4.27': 0.16; 'received:io': 0.16; 'received:messagingengine.com': 0.16; 'received:out3-smtp.messagingengine.com': 0.16; 'received:psf.io': 0.16; 'wrote:': 0.16; 'header:In-Reply-To:1': 0.24; 'mon,': 0.24; 'chris': 0.26; 'classes': 0.30; 'primarily': 0.35; 'to:addr :python-list': 0.36; 'subject:: ': 0.37; 'received:10': 0.37; 'received:66': 0.38; 'stuff': 0.38; 'to:addr:python.org': 0.40; 'header:Message-Id:1': 0.61; 'worried': 0.84
DKIM-Signature v=1; a=rsa-sha1; c=relaxed/relaxed; d=fastmail.com; h= content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=mesmtp; bh=HoUWkYas+R+xc6j9uoLoSvnyg3I=; b=Ad+3rB gsKhbqCeWSeNGBUwxpEYwKC83fTicX7569ZClL5e+cPFCCD7sT+GgA8DMXxgr2w9 mBwO2Wsn0ECobzv+VXLQ3k6+EtNY8+RGVCRfa27RK9LlIy99RbfibWSEuAX4RFMJ el40XhzEFtlS1y1Km8hmxjlTtD2yZO2xoPTFQ=
DKIM-Signature v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-sasl-enc:x-sasl-enc; s=smtpout; bh=HoUWkYas+R+xc6j 9uoLoSvnyg3I=; b=oU3asa2bfQtSICJvYEAS/8VNe9KcFqQneFrTmOtH+Nos0Hq nHyiBt2Tj7Nj7e9KbH2iBmPOl/rwkefhVdX52Q66RdG0nt6RYf1tWxTPTPH4xJQF +zletTCoYF84LrteMAyBzVHwABv8bGpPxDwBie8G8rngaMQuijDKHzbgO6KY=
X-Sasl-Enc rs9CicDrCnpBOfSTDsIC96tjLZJ9BB6QXQosIN6EHgHi 1467080841
X-Mailer MessagingEngine.com Webmail Interface - ajax-92c7b58a
In-Reply-To <CAPTjJmqLmg5tPhLnvpMOg_+NhYiNOZW_RG2yDbBiqD6MYqtxSg@mail.gmail.com>
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.22
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>
X-Mailman-Original-Message-ID <1467080841.3696367.650352489.04478540@webmail.messagingengine.com>
X-Mailman-Original-References <d5e97a5e-6f10-4e3f-ab24-113632f16f29@googlegroups.com> <CAPTjJmqLmg5tPhLnvpMOg_+NhYiNOZW_RG2yDbBiqD6MYqtxSg@mail.gmail.com>
Xref csiph.com comp.lang.python:110635

Show key headers only | View raw


On Mon, Jun 27, 2016, at 20:32, Chris Angelico wrote:
> If you're primarily worried about classes and functions, here's a neat
> trick you can use:

How about just

__all__ = [list of stuff including classes and functions]
__all__ = [x if isinstance(x, str) else x.__name__ for x in __all__]

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


Thread

__all__ attribute: bug and proposal Pavel S <pavel@schon.cz> - 2016-06-27 13:56 -0700
  Re: __all__ attribute: bug and proposal Chris Angelico <rosuav@gmail.com> - 2016-06-28 07:32 +1000
    Re: __all__ attribute: bug and proposal Pavel S <pavel@schon.cz> - 2016-06-27 15:29 -0700
      Re: __all__ attribute: bug and proposal Chris Angelico <rosuav@gmail.com> - 2016-06-28 08:41 +1000
      Re: __all__ attribute: bug and proposal Terry Reedy <tjreedy@udel.edu> - 2016-06-27 22:46 -0400
        Re: __all__ attribute: bug and proposal Steven D'Aprano <steve@pearwood.info> - 2016-06-28 13:24 +1000
  Re: __all__ attribute: bug and proposal Random832 <random832@fastmail.com> - 2016-06-27 20:25 -0400
  Re: __all__ attribute: bug and proposal Chris Angelico <rosuav@gmail.com> - 2016-06-28 10:32 +1000
  Re: __all__ attribute: bug and proposal MRAB <python@mrabarnett.plus.com> - 2016-06-28 02:55 +0100
  Re: __all__ attribute: bug and proposal Steven D'Aprano <steve@pearwood.info> - 2016-06-28 11:56 +1000
  Re: __all__ attribute: bug and proposal Chris Angelico <rosuav@gmail.com> - 2016-06-28 12:20 +1000
  Re: __all__ attribute: bug and proposal Random832 <random832@fastmail.com> - 2016-06-27 22:27 -0400
  Re: __all__ attribute: bug and proposal Zachary Ware <zachary.ware+pylist@gmail.com> - 2016-06-27 23:31 -0500
  Re: __all__ attribute: bug and proposal Ethan Furman <ethan@stoneleaf.us> - 2016-06-28 08:29 -0700

csiph-web