Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Chris Angelico Newsgroups: comp.lang.python Subject: Re: Encapsulation in Python Date: Tue, 15 Mar 2016 13:02:56 +1100 Lines: 16 Message-ID: References: <56E17985.7060002@benmezger.nl> <6984dafc-fffd-4d46-a173-421bb5c142d2@googlegroups.com> <4ddc3696-3f71-4598-98a6-929267f51fb9@googlegroups.com> <56e53cd3$0$1586$c3e8da3$5496439d@news.astraweb.com> <1376c684-2e7f-417a-9683-e47789f019fe@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: news.uni-berlin.de +HXa8rLwDWKQQ8nUjTOMoQwe8DBLAo7W9ErtukWcvMwA== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.006 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'value,': 0.03; 'subject:Python': 0.05; 'expressions': 0.07; 'cc:addr:python- list': 0.09; 'meaningful': 0.09; 'span': 0.09; '2016': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'received:209.85.213.176': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'wrote:': 0.16; 'cc:2**0': 0.20; 'cc:addr:python.org': 0.20; 'advance.': 0.23; 'header:In-Reply- To:1': 0.24; 'message-id:@mail.gmail.com': 0.27; 'entries': 0.27; 'values': 0.28; '15,': 0.30; 'regardless': 0.31; 'table': 0.32; 'tue,': 0.34; 'received:google.com': 0.35; 'but': 0.36; 'too': 0.36; 'received:209.85': 0.36; 'pm,': 0.36; 'subject:: ': 0.37; 'received:209.85.213': 0.37; 'received:209': 0.38; 'mean': 0.38; 'build': 0.40; 'still': 0.40; 'some': 0.40; 'information': 0.63; 'mar': 0.65; 'chrisa': 0.84; "it'd": 0.84; 'subject:skip:E 10': 0.96 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 :cc; bh=tKnr8mqswtPz0y129dq2CXbwytPuzOWhQiTx6pldIiI=; b=V5arz9ZbTwPmdeOgE5HI8WbtQb40wiBB19lbOzSbQ6WZetcC1tYEk9uIc9PIN/Z3c9 JIaXlFkuw36pXPFZqi12JOc/Rim+psPoxsv7lI1xYI8SmUE2SsKhRTOYGtsHN/jKEJEM IuKZMWus6+qakZsDYikPvBCUA3xyRo2f4nI61AZ9XK3V5HnDT1ksR4D2Tc9R24ApChec vaMpTrxRrujAJB2nz1so41CCIx9nJF09TSNK6j49+ytdYPIl5cvvKVw/8XM0ZAtNmZbZ 78kSWBcPpkMhCAeZ1Jf+7n0TmOZQHJHWygBoBuk1BQuz+5jEp/luwl1AGjYUTdP3JyCt wYUA== 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:date :message-id:subject:from:to:cc; bh=tKnr8mqswtPz0y129dq2CXbwytPuzOWhQiTx6pldIiI=; b=kdq/UtIOfGYmo/YtheG/2Ct2QJ5Jkwl9caox7XXKZOwnrNPzLYiGoqkon8/U9GBkjJ yXbPcAM71JUI5mjv2SpfTwJQ695BhCNb6lJLUgEZcDCTnhKK1i7zu5NgUZ3+IjC+nZwq JNql5gW/lc/++A6FmKmQkJL74tz2PvhrYc1aOKulW8d2/6Da34wl+OiyypQw5xKTYKcG j5ElPuBAwfgw6YqqOVJ0+7VgmRgnaOnSpaaDBxRnEaJ7uThCBoXDBDpZQEMwncG6kiwt dKJKD14T2LcObPICNHx5IqX74DJ/M61eNFYhPz0IZiDWKGFLoh+KzqCTeIN+NbQpLywS 1CIw== X-Gm-Message-State: AD7BkJJdjAzFYb1EoXOfEbatYJ5Ou2uqevNVp/rwmuTzB422LTvWCCFd8iCJrSZHwg9j6OWjdnIS+BqvqW/dTQ== X-Received: by 10.50.137.35 with SMTP id qf3mr21371271igb.92.1458007376577; Mon, 14 Mar 2016 19:02:56 -0700 (PDT) In-Reply-To: X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.21 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:104905 On Tue, Mar 15, 2016 at 12:22 PM, BartC wrote: > The integer-switch is intended for use with jump-tables, which requires not > only that the case expressions are known at compile-time, but that they > don't span too large a range. > Okay, which is what I mean by "compact". There'd be some lowest value and some highest value, and the table has that many entries in it, regardless of how many of them actually have meaningful information in them. With a hashtable, the values can be sparse. They would, however, still need to be constant; otherwise it'd be hard to build the table in advance. ChrisA