Path: csiph.com!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail From: Peter Otten <__peter__@web.de> Newsgroups: comp.lang.python Subject: Re: can't add variables to instances of built-in classes Date: Mon, 18 Jul 2016 09:38:33 +0200 Organization: None Lines: 14 Message-ID: References: <4f796d95-0e87-4610-a0a8-1eff07c60ace@googlegroups.com> <578b9e62$0$22141$c3e8da3$5496439d@news.astraweb.com> <3e934f83-2076-407d-b85b-686ecdec6ff8@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8Bit X-Trace: news.uni-berlin.de 7klhOMRJmEPekSBzl38z4AfnHsEPKZUn9YtJzXmWpDug== Return-Path: 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; '<>,': 0.07; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'url:github': 0.09; '2016': 0.16; '__slots__': 0.16; 'received:80.91.229.3': 0.16; 'received:dip0.t-ipconnect.de': 0.16; 'received:io': 0.16; 'received:plane.gmane.org': 0.16; 'received:psf.io': 0.16; 'received:t-ipconnect.de': 0.16; 'wrote:': 0.16; 'memory': 0.17; 'example.': 0.18; "shouldn't": 0.18; 'library': 0.20; 'lawrence': 0.22; 'header:User-Agent:1': 0.26; 'header:X-Complaints-To:1': 0.26; 'classes': 0.30; 'you?': 0.30; 'useful': 0.33; "d'aprano": 0.33; 'steven': 0.33; 'something': 0.35; 'but': 0.36; 'there': 0.36; 'monday,': 0.36; 'to:addr:python-list': 0.36; 'subject:: ': 0.37; 'received:org': 0.37; 'does': 0.39; "didn't": 0.39; 'subject:-': 0.39; 'to:addr:python.org': 0.40; 'received:de': 0.40; 'your': 0.60; 'useful.': 0.72; 'increase': 0.73; 'subject:add': 0.91 X-Injected-Via-Gmane: http://gmane.org/ X-Gmane-NNTP-Posting-Host: p57bd8330.dip0.t-ipconnect.de User-Agent: KNode/4.13.3 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: X-Mailman-Original-References: <4f796d95-0e87-4610-a0a8-1eff07c60ace@googlegroups.com> <578b9e62$0$22141$c3e8da3$5496439d@news.astraweb.com> <3e934f83-2076-407d-b85b-686ecdec6ff8@googlegroups.com> Xref: csiph.com comp.lang.python:111595 Lawrence D’Oliveiro wrote: > On Monday, July 18, 2016 at 3:04:13 AM UTC+12, Steven D'Aprano wrote: > >> __slots__ is not obsolete, but 99% of the time you shouldn't bother with >> it. > > I find __slots__ very useful. I have them right through my Qahirah classes > , for example. When you remove them, does your library stop working? Is there a significant increase of memory consumption? Or is there something I didn't think of that makes them useful for you?