[Python-Dev] Code Generation Idea Was: Bytecode idea

Skip Montanaro skip@pobox.com
Wed, 26 Feb 2003 10:22:24 -0600

    Paul> Would it be simpler to institute a special rule that True = 1 is
    Paul> silently ignored, but True = anything else generates an error
    Paul> message?  Or am I overlooking something important?

For code that wants to cleanly cross the boundary between Python with no
boolean type and Python with a boolean type, you sometimes see

    True = 1==1
    False = 1==0

You get True and False if it didn't exist before and have the added benefit
that if it does exist, it gets found in globals() or locals() instead of in
__builtins__ and has the right type.