Encapsulation in Python

Chris Angelico rosuav at gmail.com
Mon Mar 14 22:02:56 EDT 2016


On Tue, Mar 15, 2016 at 12:22 PM, BartC <bc at freeuk.com> 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



More information about the Python-list mailing list