[Python-Dev] RE: [Idle-dev] Forward progress with full backwardcompatibility

Fredrik Lundh Fredrik Lundh" <effbot@telia.com
Wed, 12 Apr 2000 22:25:56 +0200


Barry wrote:
> >>>>> "FL" =3D=3D Fredrik Lundh <effbot@telia.com> writes:
>=20
>     FL> but wouldn't something like (1, 6, 0, "a1") be easier
>     FL> to understand and use?
>=20
> I wasn't planning on splitting PY_VERSION, just in exposing the other
> #define ints in patchlevel.h

neither was I.  I just want Python to return those values in a
form suitable for a Python programmer, not a C preprocessor.

in other words:

    char release[2+1];
    sprintf(release, "%c%c", PY_RELEASE_LEVEL - 0x0A + 'a',
        PY_RELEASE_SERIAL + '0');
    sys.longversion =3D BuildTuple("iiis", PY_MAJOR_VERSION,
        PY_MINOR_VERSION, PY_MICRO_VERSION, release)

(this assumes that the release serial will never exceed 9, but
I think that's a reasonable restriction...)

</F>