Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #111574
| Path | csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail |
|---|---|
| From | Chris Angelico <rosuav@gmail.com> |
| Newsgroups | comp.lang.python |
| Subject | Re: can't add variables to instances of built-in classes |
| Date | Sun, 17 Jul 2016 22:02:31 +1000 |
| Lines | 14 |
| Message-ID | <mailman.64.1468756954.2307.python-list@python.org> (permalink) |
| References | <4f796d95-0e87-4610-a0a8-1eff07c60ace@googlegroups.com> <nmfqrg$ea7$1@ger.gmane.org> <mailman.63.1468755660.2307.python-list@python.org> <b24bede0-be29-4c45-856e-90e6a63c99d0@googlegroups.com> <CAPTjJmphwsCYJUvz-D5p048WFWoJ-cJsi3U0Xbg0SuNK8pY7aQ@mail.gmail.com> |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=UTF-8 |
| X-Trace | news.uni-berlin.de ed1V+4Syvr7UuXqenLOSEwCkkleRArCXYk7pLVnuxH8w== |
| Return-Path | <rosuav@gmail.com> |
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.012 |
| X-Spam-Evidence | '*H*': 0.98; '*S*': 0.00; 'memory.': 0.05; 'attributes': 0.07; 'stops': 0.07; 'cc:addr:python-list': 0.09; 'instances.': 0.09; 'stored': 0.10; 'python': 0.10; '2016': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'only?': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'wrote:': 0.16; 'memory': 0.17; 'instance,': 0.18; 'variable': 0.18; 'cc:2**0': 0.20; 'cc:addr:python.org': 0.20; 'leave': 0.23; 'header:In-Reply-To:1': 0.24; 'feature': 0.24; 'message- id:@mail.gmail.com': 0.27; 'program,': 0.29; "i'm": 0.30; 'that.': 0.30; 'class': 0.33; '(for': 0.34; 'received:google.com': 0.35; "isn't": 0.35; 'there': 0.36; 'pm,': 0.36; 'subject:: ': 0.37; 'being': 0.37; 'doing': 0.38; 'names': 0.38; 'why': 0.39; 'test': 0.39; 'sure': 0.39; 'enough': 0.39; 'subject:-': 0.39; 'rather': 0.39; 'your': 0.60; 'relatively': 0.63; 'worth': 0.67; 'saving': 0.70; 'jul': 0.72; 'chrisa': 0.84; 'strings)': 0.84; 'to:none': 0.91; 'subject:add': 0.91; 'wilson': 0.91 |
| DKIM-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:cc; bh=7PWY9HR8EBTMwRxkBR4NNzbqPglykbFMMADbm4cWckk=; b=YvWx+LBGd2wRYLGG5JtMhnTJOezhz7C7SXDU2Lb8TKFu4BXModeUVS10LYlYW52eaL wytYNMDcvKPZvqJ9quNfskx34opb5uwifmEjn4C9r9HzD5ns09ACBik11rjo+8eR62BH 7P49/nGXlP54WHrPrcV46yEWu0koIxYyFiJwHBI2eIkTP02oXltaiShJLxptWZRcCFVs Rnexi1DEmtB2oY4xvQVcPaX/EqScVXzmfNRdAwFGMXH2dKq+3KX3IUFOQgNNxTzkh5QD MZlH7NPlmyR9d32Qg9Dyowq4wOQxZx0W1wonA2duj22iFouiAUpAq7T/NOFBR3VbOod/ nh7g== |
| X-Google-DKIM-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:cc; bh=7PWY9HR8EBTMwRxkBR4NNzbqPglykbFMMADbm4cWckk=; b=Sw8hu5Jh9zdIMy1nYvS/p2qXnbuBEpUFPppoRJ8LMtJquISIzVPOJiB0SaXNv69AMx qtcYVG9/oZwxu8Xy/hrRDA6iH8J/OsYxMrzeWIu6oE1vrHgTGUZVa7Ea0N21SHbj2tQZ Xkyo5lBxzRjtrxKiKMO8rwpU6WfGqqDzhurX3jheVNnB1f6AEeip2POoAbIrMnT1iMGE nUEjnFt8jTLPOO+1ZDMCW16pgBNt2GbJ21fnJR8xpQALdBdP+S+HedGV2t7OBRSDPwvu NBVofgGmieLCAC4oGWyBZyBGoHu+L4Cp9cHk6FRNdpJeBg1K2eOunzYgu0p28GECdMMN 0r1g== |
| X-Gm-Message-State | ALyK8tJod7CqhaZDgFjOBfsHK+T5UVCvHy9rgrGL+8jnKHKWadgreyoK2h3ebZa1w1HpFMoMy9uridH6iMYSbg== |
| X-Received | by 10.28.1.23 with SMTP id 23mr31828481wmb.22.1468756951807; Sun, 17 Jul 2016 05:02:31 -0700 (PDT) |
| In-Reply-To | <b24bede0-be29-4c45-856e-90e6a63c99d0@googlegroups.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 | <CAPTjJmphwsCYJUvz-D5p048WFWoJ-cJsi3U0Xbg0SuNK8pY7aQ@mail.gmail.com> |
| X-Mailman-Original-References | <4f796d95-0e87-4610-a0a8-1eff07c60ace@googlegroups.com> <nmfqrg$ea7$1@ger.gmane.org> <mailman.63.1468755660.2307.python-list@python.org> <b24bede0-be29-4c45-856e-90e6a63c99d0@googlegroups.com> |
| Xref | csiph.com comp.lang.python:111574 |
Show key headers only | View raw
On Sun, Jul 17, 2016 at 9:50 PM, Wilson Ong <wilsonokw@gmail.com> wrote: >> Use this feature sparingly, only when you know that there are going to be >> many (millions rather than thousands) of Test instances. > > Why use it sparingly? Is it for extensibility? What if I'm pretty sure that my class is going to have exactly these attributes only? "Pretty sure" isn't enough justification for a relatively meagre saving of memory. Much easier to leave it flexible. It's only once the memory saving stops being "relatively meagre" (for instance, with the built-in 'str' type - there are a LOT of strings in a Python program, since your variable names are stored as strings) that it's worth doing that. ChrisA
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
can't add variables to instances of built-in classes Kent Tong <kent.tong.mo@gmail.com> - 2016-07-17 03:57 -0700
Re: can't add variables to instances of built-in classes Peter Otten <__peter__@web.de> - 2016-07-17 13:40 +0200
Re: can't add variables to instances of built-in classes Wilson Ong <wilsonokw@gmail.com> - 2016-07-17 04:50 -0700
Re: can't add variables to instances of built-in classes Chris Angelico <rosuav@gmail.com> - 2016-07-17 22:02 +1000
Re: can't add variables to instances of built-in classes Steven D'Aprano <steve@pearwood.info> - 2016-07-18 01:04 +1000
Re: can't add variables to instances of built-in classes Lawrence D’Oliveiro <lawrencedo99@gmail.com> - 2016-07-17 20:00 -0700
Re: can't add variables to instances of built-in classes Peter Otten <__peter__@web.de> - 2016-07-18 09:38 +0200
Re: can't add variables to instances of built-in classes Lawrence D’Oliveiro <lawrencedo99@gmail.com> - 2016-07-18 14:48 -0700
Re: can't add variables to instances of built-in classes breamoreboy@gmail.com - 2016-07-18 16:12 -0700
Re: can't add variables to instances of built-in classes Lawrence D’Oliveiro <lawrencedo99@gmail.com> - 2016-07-18 19:53 -0700
Re: can't add variables to instances of built-in classes breamoreboy@gmail.com - 2016-07-19 14:24 -0700
Re: can't add variables to instances of built-in classes Lawrence D’Oliveiro <lawrencedo99@gmail.com> - 2016-07-19 16:58 -0700
Re: can't add variables to instances of built-in classes Chris Angelico <rosuav@gmail.com> - 2016-07-20 16:19 +1000
Re: can't add variables to instances of built-in classes Lawrence D’Oliveiro <lawrencedo99@gmail.com> - 2016-07-19 23:45 -0700
Re: can't add variables to instances of built-in classes Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2016-07-20 17:22 +1000
Re: can't add variables to instances of built-in classes Peter Otten <__peter__@web.de> - 2016-07-20 09:26 +0200
Re: can't add variables to instances of built-in classes Lawrence D’Oliveiro <lawrencedo99@gmail.com> - 2016-07-20 01:50 -0700
Re: can't add variables to instances of built-in classes Peter Otten <__peter__@web.de> - 2016-07-20 11:15 +0200
Re: can't add variables to instances of built-in classes Lawrence D’Oliveiro <lawrencedo99@gmail.com> - 2016-07-20 15:11 -0700
Re: can't add variables to instances of built-in classes Chris Angelico <rosuav@gmail.com> - 2016-07-21 12:29 +1000
Re: can't add variables to instances of built-in classes Lawrence D’Oliveiro <lawrencedo99@gmail.com> - 2016-08-03 19:34 -0700
Re: can't add variables to instances of built-in classes Chris Angelico <rosuav@gmail.com> - 2016-08-04 13:00 +1000
Re: can't add variables to instances of built-in classes Lawrence D’Oliveiro <lawrencedo99@gmail.com> - 2016-08-04 16:57 -0700
Re: can't add variables to instances of built-in classes Steven D'Aprano <steve@pearwood.info> - 2016-07-21 12:48 +1000
Re: can't add variables to instances of built-in classes Steven D'Aprano <steve@pearwood.info> - 2016-07-20 22:10 +1000
Re: can't add variables to instances of built-in classes Lawrence D’Oliveiro <lawrencedo99@gmail.com> - 2016-07-20 14:48 -0700
Re: can't add variables to instances of built-in classes breamoreboy@gmail.com - 2016-07-20 18:04 -0700
Re: can't add variables to instances of built-in classes Peter Otten <__peter__@web.de> - 2016-07-21 08:59 +0200
Re: can't add variables to instances of built-in classes Lawrence D’Oliveiro <lawrencedo99@gmail.com> - 2016-07-20 02:10 -0700
Re: can't add variables to instances of built-in classes Ethan Furman <ethan@stoneleaf.us> - 2016-07-18 06:10 -0700
Re: can't add variables to instances of built-in classes Kent Tong <kent.tong.mo@gmail.com> - 2016-07-17 04:53 -0700
csiph-web