A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2001-October/017883.html below:

[Python-Dev] Bug or feature? Unicode vs t#

[Python-Dev] Bug or feature? Unicode vs t# [Python-Dev] Bug or feature? Unicode vs t#Paul Prescod paul@ActiveState.com
Thu, 11 Oct 2001 09:36:51 -0700
"Martin v. Loewis" wrote:
> 
>...
> 
> For Unicode objects, these are different: getcharbuffer converts the
> string using the default encoding into a character string, whereas

What is the use case for treating a Unicode object as if it were a
buffer of bytes by translating it to the default encoding?

"Python objects implemented in C can export a group of functions called
the ``buffer interface.'' These functions can be used by an object to
expose its data in a raw, byte-oriented format. Clients of the object
can use the buffer interface to access the object data directly, without
needing to copy it first."

Translating the data before handing it to the user violates the
"raw"-ness of the byte-oriented format and the principle about not
needing to copy it. It behaves quite differently than other
implementations of getcharbuffer. 

 Paul Prescod



RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4