[Python-3000] bytes & Py_TPFLAGS_BASETYPE (original) (raw)

Guido van Rossum guido at python.org
Mon Sep 17 20:44:33 CEST 2007


I understand. But bytes are still in flux (see the repeated requests for immutable bytes) and I don't want to commit to anything just yet.

On 9/17/07, Mathieu Fenniak <mathieu.fenniak at gmail.com> wrote:

On 17-Sep-07, at 11:53 AM, Guido van Rossum wrote: >> "writeToStream" method that serializes the object -- a byte string >> would write out <68656c6c6f>, a text string (hello), and so on for >> other more complex types (dictionaries, labels, arrays, PDF data >> streams). The type is also responsible for encrypting itself when >> applicable. > > This sounds like a perfect application for generic functions instead > of subclassing.

Sure, there are other options for writing and organizing this code. But, this is a valid application of subclassing the bytes type, and it is the method I would prefer to be able to implement. Mathieu

-- --Guido van Rossum (home page: http://www.python.org/~guido/)



More information about the Python-3000 mailing list