[Python-Dev] Python's Unicode width default (New Py_UNICODE doc)

M.-A. Lemburg mal at egenix.com
Mon May 9 18:29:59 CEST 2005

[Python used to always default to UCS2-Unicode builds;
 this was changed to default to whatever a possibly installed
 TCL system is using - hiding the choice from the user
 and in effect removing the notion of having a Python
 Unicode default configuration]

Martin v. Löwis wrote:
> M.-A. Lemburg wrote:
>>I believe that it would be more appropriate to adjust the _tkinter
>>module to adapt to the TCL Unicode size rather than
>>forcing the complete Python system to adapt to TCL - I don't
>>really see the point in an optional extension module
>>defining the default for the interpreter core.
> _tkinter currently supports, for a UCS-2 Tcl, both UCS-2 and UCS-4
> Python. For an UCS-4 Tcl, it requires Python also to be UCS-4.
> Contributions to support the missing case are welcome.

I'm no expert for _tkinter and don't use it, so I'm
the wrong one to ask :-)

However, making Python's own default depend on some
3rd party software on the machines is bad design.

>>At the very least, this should be a user controlled option.
> It is: by passing --enable-unicode=ucs2, you can force Python
> to use UCS-2 even if Tcl is UCS-4, with the result that
> _tkinter cannot be built anymore (and compilation fails
> with an #error).

I think we should remove the defaulting to whatever
TCL uses and instead warn the user about a possible
problem in case TCL is found and uses a Unicode
width which is incompatible with Python's choice.

The user can then decide whether she finds
_tkinter important enough to turn away from the standard
Python default Unicode width or not (with all the
consequences that go with it, e.g. memory bloat,
problems installing binaries precompiled for standard
Python builds, etc.). This should definitely *not* be
done automatically.

Marc-Andre Lemburg

Professional Python Services directly from the Source  (#1, May 09 2005)
>>> Python/Zope Consulting and Support ...        http://www.egenix.com/
>>> mxODBC.Zope.Database.Adapter ...             http://zope.egenix.com/
>>> mxODBC, mxDateTime, mxTextTools ...        http://python.egenix.com/

::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! ::::

More information about the Python-Dev mailing list