The Cost of Dynamism (was Re: Pyhon 2.x or 3.x, which is faster?)

Steven D'Aprano steve at pearwood.info
Mon Mar 21 11:09:44 EDT 2016


On Tue, 22 Mar 2016 01:04 am, Random832 wrote:

> On Mon, Mar 21, 2016, at 09:48, Steven D'Aprano wrote:
>> Pardon me, do I understand you correctly? You're saying that the C parser
>> is
>> Unicode-aware and allows you to use Unicode in C source code?
> 
> Er, "the" C parser?
> 
> In the C standard, the source character set is implementation-defined,
> and is specifically called out that it "may contain multibyte
> characters, used to represent members of the extended character set".
> 
> But that's really not the point here, the point is that expecting an
> implementation of a character-based switch statement in Python to be
> able to rely on there only being 256 characters is unreasonable.

Nobody has suggested that. Bart suggested that *his application* would use a
256 table. You trimmed the part of my post that quoted him:

"For Python I would have used a table of 0..255 functions"

Bart, like any of us, is perfectly entitled to only handle 8-bit ASCII
(Latin-1 perhaps?) if he chooses, and he wasn't talking about any
hypothetical future switch statement.



-- 
Steven




More information about the Python-list mailing list