Path: csiph.com!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail From: Chris Angelico Newsgroups: comp.lang.python Subject: Re: how to get names of attributes Date: Wed, 30 Dec 2015 23:50:03 +1100 Lines: 23 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: news.uni-berlin.de pLns5u3vsntJfDf6jfK4PgU2O7UqAdHnnv/9wmqI4sJw== 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; 'received:209.85.223': 0.03; 'true,': 0.04; 'classes.': 0.07; 'cc:addr:python-list': 0.09; 'object)': 0.09; 'wed,': 0.15; '"by': 0.16; '"def"': 0.16; 'dictionaries': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'new-style': 0.16; 'objects?': 0.16; 'old-style': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'wrote:': 0.16; '2015': 0.20; 'cc:2**0': 0.20; 'cc:addr:python.org': 0.20; 'doc': 0.22; 'dec': 0.23; 'header:In-Reply-To:1': 0.24; 'message- id:@mail.gmail.com': 0.27; 'referenced': 0.29; 'classes': 0.30; 'class.': 0.30; 'received:google.com': 0.35; 'there': 0.36; 'received:209.85': 0.36; 'pm,': 0.36; 'subject:: ': 0.37; 'received:209': 0.38; 'still': 0.40; 'default': 0.61; '30,': 0.63; 'believe': 0.66; 'smith': 0.76; 'subject:get': 0.81; 'chrisa': 0.84; 'to:none': 0.91 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:cc :content-type; bh=eFkgzvGAX+ZYqgl9HK/pLCPPoXeswCpum/nRo53I2+c=; b=rnim60rnF5uDjQzN4QED9xI0/BoUvu/RpFAgNuHFUgVqXSVzvfVSzPz+sHyOehcYA/ ByTH/IXXq5dMJZkVyq7QEesYaZJVahcHtFuS5hGupY9hJFiYw3wYfWZg7ajxm8T1YpBv 0BZkU6kvvSmdU7gcg5gncks3Qmd9dHvKmgVL2Kodu7EZTZeFPdzOU5BEPNyNAAUwvs0X BNT4fVxe/5M3Lr9S9QTCpOsFiC4BMCJlfUxaxL2+fsglIh0Gf//FNQfxvKPvpyuE61/w Ce5vOT703jdl2/HZ6JXS7O/txghz8xzbSMcENXOmst7okyg7OLKCNicNj14F8KOh85ii 0Y0g== X-Received: by 10.107.47.162 with SMTP id v34mr14578778iov.19.1451479803264; Wed, 30 Dec 2015 04:50:03 -0800 (PST) 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:100987 On Wed, Dec 30, 2015 at 11:40 PM, Charles T. Smith wrote: > Oh! > > Although the referenced doc says: > > "For compatibility reasons, classes are still old-style by default." > > is it true that dictionaries are by default always new-style objects? > > (PDB)c6 = { "abc" : 123, "def" : 456} > > (PDB)isinstance (c6, dict) > True > > (PDB)isinstance (c6, object) > True I believe that's true, yes. The meaning of "by default" there is that "class X: pass" will make an old-style class. All built-in types are now new-style classes. ChrisA