[Python-Dev] last second patches (was: regarding the Python Developer posting...)

Fredrik Lundh Fredrik Lundh" <effbot@telia.com
Mon, 25 Sep 2000 19:18:21 +0200


in response to a OS X compiler problem, mal wrote:
> You could try to enable the macro at the top of unicodectype.c:
>  
> #if defined(macintosh) || defined(MS_WIN64)
> /*XXX This was required to avoid a compiler error for an early Win64
>  * cross-compiler that was used for the port to Win64. When the platform is
>  * released the MS_WIN64 inclusion here should no longer be necessary.
>  */
> /* This probably needs to be defined for some other compilers too. It breaks the
> ** 5000-label switch statement up into switches with around 1000 cases each.
> */
> #define BREAK_SWITCH_UP return 1; } switch (ch) {
> #else
> #define BREAK_SWITCH_UP /* nothing */
> #endif
> 
> If it does compile with the work-around enabled, please
> give us a set of defines which identify the compiler and
> platform so we can enable it per default for your setup.

I have a 500k "negative patch" sitting on my machine which removes
most of unicodectype.c, replacing it with a small data table (based on
the same unidb work as yesterdays unicodedatabase patch).

out
</F>

# dump all known unicode data

import unicodedata

for i in range(65536):
    char = unichr(i)
    data = (
        # ctype predicates
        char.isalnum(),
        char.isalpha(),
        char.isdecimal(),
        char.isdigit(),
        char.islower(),
        char.isnumeric(),
        char.isspace(),
        char.istitle(),
        char.isupper(),
        # ctype mappings
        char.lower(),
        char.upper(),
        char.title(),
        # properties
        unicodedata.digit(char, None),
        unicodedata.numeric(char, None),
        unicodedata.decimal(char, None),
        unicodedata.category(char),
        unicodedata.bidirectional(char),
        unicodedata.decomposition(char),
        unicodedata.mirrored(char),
        unicodedata.combining(char)
        )