[Python-Dev] just say no...

Greg Stein gstein@lyra.org
Fri, 12 Nov 1999 14:59:03 -0800 (PST)


On Fri, 12 Nov 1999, M.-A. Lemburg wrote:
> Fredrik Lundh wrote:
> > > Besides, the Unicode object will have a buffer containing the
> > > <default encoding> representation of the object, which, if all goes
> > > well, will always hold the UTF-8 value.
> > 
> > <rant>
> > 
> > over my dead body, that one...
> 
> Such a buffer is needed to implement "s" and "s#" argument
> parsing. It's a simple requirement to support those two
> parsing markers -- there's not much to argue about, really...
> unless, of course, you want to give up Unicode object support
> for all APIs using these parsers.

Bull!

You can easily support "s#" support by returning the pointer to the
Unicode buffer. The *entire* reason for introducing "t#" is to
differentiate between returning a pointer to an 8-bit [character] buffer
and a not-8-bit buffer.

In other words, the work done to introduce "t#" was done *SPECIFICALLY* to
allow "s#" to return a pointer to the Unicode data.

I am with Fredrik on that auxilliary buffer. You'll have two dead bodies
to deal with :-)

Cheers,
-g

--
Greg Stein, http://www.lyra.org/