[Python-Dev] Unicode support in getargs.c
Martin v. Loewis
martin@v.loewis.de
Wed, 2 Jan 2002 21:29:02 +0100
> > > All this weird behaviour is needed to make Unicode objects
> > > behave well together with s#.
> >
> > I don't believe this. Why would the implementation of u# have any
> > effect on making s# work?
[...]
> u# is simply a copy&paste implementation of s# interpreting the
> results of the read buffer interface as Py_UNICODE array.
Ok. That explains its history, but it also clarifies that changing the
u# implementation has *no* effect whatsoever proper operation of s#.
Therefore, I still think that u# should reject string objects, instead
of silently doing the wrong thing.
> As I menioned in another mail, we should probably let u# pass
> through Unicode objects as-is without going through the read buffer
> interface.
Yes, that would be nice. The only use of u# I can see is that it gives
you the number of Py_UNICODE characters, so that the caller doesn't
have to look for the terminating NUL.
Regards,
Martin