[Python-Dev] PEP 460 reboot (original) (raw)

Greg Ewing greg.ewing at canterbury.ac.nz
Wed Jan 15 00:05:20 CET 2014


Ethan Furman wrote:

On 01/14/2014 10:11 AM, Jim J. Jewett wrote:

But in terms of explaining the text model, that separation is important enough that (2) It may be worth creating a virtual split in the documentation. I think (2) is a great idea.

I don't think it's such a great idea to belabour this point.

The notion of an ASCIIStructuredBytes type seems to assume that you have either ascii-encoded text or some other kind of data. But many of the use cases for all of this involve constructing a single object, parts of which are one and parts of which are another. It's hard to think of that in terms of virtual classes unless you're willing to imagine that different parts of the same object are of different types, which, for a primitive object like bytes, doesn't make sense in the context of the Python object model.

By all means point out that the ascii features of bytes are intended for use on data that happens to be ascii, and shouldn't be used otherwise. But I think that talking about "virtual classes" just risks confusing people, particulary when we have ABCs, which are also a kind of virtual class represented by real class objects.

-- Greg



More information about the Python-Dev mailing list