Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Random832 Newsgroups: comp.lang.python Subject: Re: __all__ attribute: bug and proposal Date: Mon, 27 Jun 2016 22:27:21 -0400 Lines: 8 Message-ID: References: <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: 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: X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Mailman-Original-Message-ID: <1467080841.3696367.650352489.04478540@webmail.messagingengine.com> X-Mailman-Original-References: Xref: csiph.com comp.lang.python:110635 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__]