Path: csiph.com!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail From: Serhiy Storchaka Newsgroups: comp.lang.python Subject: Re: Is vars() the most useless Python built-in ever? Date: Fri, 4 Dec 2015 10:42:16 +0200 Lines: 16 Message-ID: References: <565cf141$0$1612$c3e8da3$5496439d@news.astraweb.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Trace: news.uni-berlin.de R9UaUmDwqZdrIBDOLnXipAPod75omkwhnCGZyivtZjbg== Return-Path: 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; 'subject:Python': 0.05; 'exception.': 0.07; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'wed,': 0.15; '__slots__': 0.16; 'received:80.91.229.3': 0.16; 'received:io': 0.16; 'received:plane.gmane.org': 0.16; 'received:psf.io': 0.16; 'sad': 0.16; 'subject:ever': 0.16; 'subject:most': 0.16; 'wrote:': 0.16; "wouldn't": 0.16; '>>>': 0.20; '2015': 0.20; 'exists.': 0.22; 'trying': 0.22; 'dec': 0.23; 'this:': 0.23; 'header:In-Reply-To:1': 0.24; 'url:bugs': 0.24; 'header:User-Agent:1': 0.26; "doesn't": 0.26; 'header:X -Complaints-To:1': 0.26; 'chris': 0.26; "i'm": 0.30; 'post': 0.31; 'anyone': 0.32; 'maybe': 0.33; 'useful': 0.33; 'url:python': 0.33; "d'aprano": 0.33; 'raising': 0.33; 'steven': 0.33; 'open': 0.33; 'there': 0.36; 'url:org': 0.36; 'to:addr:python-list': 0.36; 'subject:?': 0.36; 'pm,': 0.36; 'subject:: ': 0.37; 'there,': 0.37; 'received:org': 0.37; 'environment.': 0.37; 'times.': 0.38; 'why': 0.39; 'does': 0.39; 'subject:the': 0.39; 'subject:-': 0.39; 'to:addr:python.org': 0.40; 'some': 0.40; 'charset:windows-1252': 0.62; 'more': 0.63; 'grow': 0.75 X-Injected-Via-Gmane: http://gmane.org/ X-Gmane-NNTP-Posting-Host: 193.202.118.162 User-Agent: Mozilla/5.0 (X11; Linux i686; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 In-Reply-To: X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.20+ Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Xref: csiph.com comp.lang.python:99998 On 02.12.15 11:28, Chris Angelico wrote: > On Wed, Dec 2, 2015 at 7:22 PM, Serhiy Storchaka wrote: >> On 01.12.15 03:00, Steven D'Aprano wrote: >>> I'm trying to understand why vars() exists. Does anyone use it? >> I use vars() exclusively for introspection in interactive environment. As >> well as dir() and help(). Sad that it doesn't work with __slots__. > Maybe the upshot of all this is a post to python-ideas recommending > that vars() grow support for __slots__ types? If it's most often used > interactively, this would make it more useful there, and it wouldn't > break backward compatibility unless there's some way that people are > depending on it raising an exception. It already was discussed few times. And there is even open issue for this: http://bugs.python.org/issue13290.