Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #59072
| Path | csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder4.news.weretis.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail |
|---|---|
| Return-Path | <rosuav@gmail.com> |
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.014 |
| X-Spam-Evidence | '*H*': 0.97; '*S*': 0.00; 'subject:Python': 0.06; '32-bit': 0.09; 'lookup': 0.09; 'lst': 0.09; 'pointers': 0.09; 'referenced': 0.09; 'random': 0.14; 'cheap.': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'kern': 0.16; 'reasonably': 0.16; 'subject:user': 0.16; 'write,': 0.16; 'wrote:': 0.18; '>>>': 0.22; 'example': 0.22; 'bytes': 0.24; 'certainly': 0.24; 'replace': 0.24; 'fairly': 0.24; 'mon,': 0.24; "i've": 0.25; 'nearly': 0.26; 'tables': 0.26; 'header:In-Reply- To:1': 0.27; 'array': 0.29; 'robert': 0.30; 'said,': 0.30; 'message-id:@mail.gmail.com': 0.30; "i'm": 0.30; 'code': 0.31; 'overhead': 0.31; 'steven': 0.31; 'quite': 0.32; "i'd": 0.34; 'could': 0.34; 'beyond': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'really': 0.36; 'done': 0.36; 'subject:New': 0.37; 'implement': 0.38; 'generic': 0.38; 'nov': 0.38; 'to:addr:python- list': 0.38; 'pm,': 0.38; 'to:addr:python.org': 0.39; 'system.': 0.39; 'manually': 0.60; 'subject: / ': 0.60; 'hope': 0.61; 'close': 0.67; '10%': 0.74; 'entry,': 0.84; 'heh.': 0.84; '1,000,000': 0.91; 'technique': 0.93; '2013': 0.98 |
| 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:to :content-type; bh=w7n4g7eBlRmnAzQg0y4kfXkS9pzGsH3bMDx9xb/F2BQ=; b=X4tljXzkHnIvUc8XzBSTOU33ZwF6NWCyJ9cEj6rUlrq4p6FPX7K+o4oi74/Y2g4x92 q7vkv53MmKqAZeSodqwGCGfzkc4a/UC2GgGoAOW2/73WpkT/6/hNoe4D1t/JohTWJhGF tONwWdZVIIG6QYnztOzy1Bx6UX22WhtvFotj2YYvho5nb5auG+f97OYgPdamQ+LAXjn7 XqxS7wsV58taJay4SWcqln09Jp+2qGnnkefKSzw7QQWyIcb2jxqbIGzi/6qG+xayoi4h 5smoCGJS8XDgagXZ/zRW5cnVeTajbGGQ4qYgJKwHaJSRD8fj/jS2ezUG9zUJlEg8Pcwe O/bw== |
| MIME-Version | 1.0 |
| X-Received | by 10.68.110.196 with SMTP id ic4mr29337717pbb.84.1384171648308; Mon, 11 Nov 2013 04:07:28 -0800 (PST) |
| In-Reply-To | <l5qgfr$8rd$1@ger.gmane.org> |
| References | <-JadnUirYuhUruPPnZ2dnUVZ8rSdnZ2d@bt.com> <1c4c0901-f80a-42f3-9df5-7e7431353079@googlegroups.com> <CAPTjJmp-aATt7qz9_Hyxu+ex+OcpxbhfVGW0EwMtGrVxpHONHg@mail.gmail.com> <l5qgfr$8rd$1@ger.gmane.org> |
| Date | Mon, 11 Nov 2013 23:07:28 +1100 |
| Subject | Re: New user's initial thoughts / criticisms of Python |
| From | Chris Angelico <rosuav@gmail.com> |
| To | python-list@python.org |
| Content-Type | text/plain; charset=ISO-8859-1 |
| X-BeenThere | python-list@python.org |
| X-Mailman-Version | 2.1.15 |
| 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> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.2375.1384171657.18130.python-list@python.org> (permalink) |
| Lines | 23 |
| NNTP-Posting-Host | 2001:888:2000:d::a6 |
| X-Trace | 1384171657 news.xs4all.nl 15935 [2001:888:2000:d::a6]:46887 |
| X-Complaints-To | abuse@xs4all.nl |
| Xref | csiph.com comp.lang.python:59072 |
Show key headers only | View raw
On Mon, Nov 11, 2013 at 10:53 PM, Robert Kern <robert.kern@gmail.com> wrote: > Heh. I've done pretty much exactly the same thing to implement an engine[1] > to draw from the random tables on Abulafia[2] which have nearly the same > structure. It scales up reasonably well beyond d100s. It's certainly not a > technique I would pull out to replace one-off if-elif chains that you > literally write, but it works well when you write the generic code once to > apply to many tables. I'd trust my current code for several orders of magnitude beyond where I'm currently using it, but as Steven said, you really don't want to be manually looking at the denormalized tables. Since all the strings are referenced anyway, having a lookup array of (say) 1,000,000 object pointers is fairly cheap. >>> lst = ["Low" if i<500000 else "High" for i in range(1000000)] >>> sys.getsizeof(lst) 4348736 That's pretty close to four bytes per entry, which would be the cheapest you could hope for on a 32-bit system. 10% overhead is quite acceptable. And this is a fairly extreme example :) ChrisA
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
New user's initial thoughts / criticisms of Python John von Horn <j.h69@btinternet.com> - 2013-11-09 07:08 -0600
Re: New user's initial thoughts / criticisms of Python Ned Batchelder <ned@nedbatchelder.com> - 2013-11-09 05:22 -0800
Re: New user's initial thoughts / criticisms of Python Joshua Landau <joshua@landau.ws> - 2013-11-09 13:27 +0000
Re: New user's initial thoughts / criticisms of Python Jonathan <jtcegh@gmail.com> - 2013-11-09 14:44 -0800
Re: New user's initial thoughts / criticisms of Python Chris Angelico <rosuav@gmail.com> - 2013-11-10 10:29 +1100
Re: New user's initial thoughts / criticisms of Python MRAB <python@mrabarnett.plus.com> - 2013-11-10 00:50 +0000
Re: New user's initial thoughts / criticisms of Python Chris Angelico <rosuav@gmail.com> - 2013-11-10 11:54 +1100
Re: New user's initial thoughts / criticisms of Python Neil Cerutti <neilc@norwich.edu> - 2013-11-11 15:30 +0000
Re: New user's initial thoughts / criticisms of Python Thomas Rachel <nutznetz-0c1b6768-bfa9-48d5-a470-7603bd3aa915@spamschutz.glglgl.de> - 2013-11-10 13:24 +0100
Re: New user's initial thoughts / criticisms of Python Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-11-09 13:41 +0000
Re: New user's initial thoughts / criticisms of Python Jussi Piitulainen <jpiitula@ling.helsinki.fi> - 2013-11-09 16:24 +0200
Re: New user's initial thoughts / criticisms of Python Chris Angelico <rosuav@gmail.com> - 2013-11-10 01:27 +1100
Sandboxing Python [was Re: New user's initial thoughts / criticisms of Python] Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-11-09 15:25 +0000
Re: Sandboxing Python [was Re: New user's initial thoughts / criticisms of Python] Chris Angelico <rosuav@gmail.com> - 2013-11-10 02:32 +1100
Re: New user's initial thoughts / criticisms of Python Jorgen Grahn <grahn+nntp@snipabacken.se> - 2013-11-10 08:47 +0000
Re: New user's initial thoughts / criticisms of Python Chris Angelico <rosuav@gmail.com> - 2013-11-10 20:22 +1100
Re: New user's initial thoughts / criticisms of Python Ian Kelly <ian.g.kelly@gmail.com> - 2013-11-10 04:39 -0700
Re: New user's initial thoughts / criticisms of Python Chris Angelico <rosuav@gmail.com> - 2013-11-10 22:43 +1100
Re: New user's initial thoughts / criticisms of Python Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2013-11-10 12:12 -0500
Re: New user's initial thoughts / criticisms of Python Chris Angelico <rosuav@gmail.com> - 2013-11-11 10:29 +1100
Re: New user's initial thoughts / criticisms of Python Terry Reedy <tjreedy@udel.edu> - 2013-11-10 19:13 -0500
Re: New user's initial thoughts / criticisms of Python rusi <rustompmody@gmail.com> - 2013-11-09 07:38 -0800
Re: New user's initial thoughts / criticisms of Python Roy Smith <roy@panix.com> - 2013-11-09 10:56 -0500
Re: New user's initial thoughts / criticisms of Python rusi <rustompmody@gmail.com> - 2013-11-09 08:30 -0800
Re: New user's initial thoughts / criticisms of Python Rick Johnson <rantingrickjohnson@gmail.com> - 2013-11-10 21:36 -0800
Re: New user's initial thoughts / criticisms of Python Roy Smith <roy@panix.com> - 2013-11-11 09:01 -0500
Re: New user's initial thoughts / criticisms of Python rusi <rustompmody@gmail.com> - 2013-11-11 07:14 -0800
Re: New user's initial thoughts / criticisms of Python Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2013-11-11 21:05 -0500
Re: New user's initial thoughts / criticisms of Python Ethan Furman <ethan@stoneleaf.us> - 2013-11-12 14:38 -0800
Re: New user's initial thoughts / criticisms of Python John von Horn <j.h69@btinternet.com> - 2013-11-09 14:19 -0600
Re: New user's initial thoughts / criticisms of Python Tim Chase <python.list@tim.thechases.com> - 2013-11-09 14:39 -0600
Re: New user's initial thoughts / criticisms of Python Mark Janssen <dreamingforward@gmail.com> - 2013-11-09 12:33 -0800
Re: New user's initial thoughts / criticisms of Python Ned Batchelder <ned@nedbatchelder.com> - 2013-11-09 12:54 -0800
Re: New user's initial thoughts / criticisms of Python Mark Janssen <dreamingforward@gmail.com> - 2013-11-09 13:21 -0800
Re: New user's initial thoughts / criticisms of Python Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-11-09 21:01 +0000
Re: New user's initial thoughts / criticisms of Python Tim Chase <python.list@tim.thechases.com> - 2013-11-09 15:20 -0600
Re: New user's initial thoughts / criticisms of Python lorenzo.gatti@gmail.com - 2013-11-11 02:09 -0800
Re: New user's initial thoughts / criticisms of Python Chris Angelico <rosuav@gmail.com> - 2013-11-11 21:39 +1100
Re: New user's initial thoughts / criticisms of Python Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-11-11 11:17 +0000
Re: New user's initial thoughts / criticisms of Python Chris Angelico <rosuav@gmail.com> - 2013-11-11 22:32 +1100
Re: New user's initial thoughts / criticisms of Python Mark Janssen <dreamingforward@gmail.com> - 2013-11-11 14:29 -0800
Re: New user's initial thoughts / criticisms of Python Robert Kern <robert.kern@gmail.com> - 2013-11-11 11:53 +0000
Re: New user's initial thoughts / criticisms of Python Chris Angelico <rosuav@gmail.com> - 2013-11-11 23:07 +1100
Re: New user's initial thoughts / criticisms of Python Joshua Landau <joshua@landau.ws> - 2013-11-11 20:50 +0000
Re: New user's initial thoughts / criticisms of Python Chris Angelico <rosuav@gmail.com> - 2013-11-12 09:21 +1100
Re: New user's initial thoughts / criticisms of Python Joshua Landau <joshua@landau.ws> - 2013-11-12 01:53 +0000
csiph-web