[Python-3000] bytes & Py_TPFLAGS_BASETYPE (original) (raw)
Mathieu Fenniak mathieu.fenniak at gmail.com
Mon Sep 17 20:33:18 CEST 2007
- Previous message: [Python-3000] bytes & Py_TPFLAGS_BASETYPE
- Next message: [Python-3000] bytes & Py_TPFLAGS_BASETYPE
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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
- Previous message: [Python-3000] bytes & Py_TPFLAGS_BASETYPE
- Next message: [Python-3000] bytes & Py_TPFLAGS_BASETYPE
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]