[Python-Dev] PEP 296 - The Buffer Problem
Scott Gilbert
xscottg@yahoo.com
Wed, 24 Jul 2002 01:13:26 -0700 (PDT)
--- Thomas Heller <thomas.heller@ion-tof.com> wrote:
>
> I've quickly read the pep again.
> I see no mentioning of an 'inner object' and an 'outer object'
> there, so I would recommend you try to explain this (if you want to stay
> with this decision).
>
This is just the terminology I was using to try and communicate with you.
The outer thing is the bytes object (which is generally interesting to
users), and the inner thing is an implementation detail. Like I said, I'll
add more text on this in the next revision since it seems to be causing
confusion.
>
> OTOH, your 'inner thing' has a refcount, an (optional) destructor
> which is a kind of closure, instance variables (memory pointer,
> readonly flag), so there is not too much missing for a full
> python object.
>
I still haven't heard a good reason to expose the inner thing to user code
yet though. So even if the inner thing is a PyObject, who would know?
It's probably better for maintenance to use something everyone is already
familiar with, so I'll probably do it for that reason.
>
> Could the 'inner thing' have the same type as the 'outer thing':
> the inner thing being a full view of itself, and the outer thing
> probably a view viewing only a slice of the inner thing?
>
It might be. However, I'm afraid this will lead to some ugly special cases
when the view is the inner thing versus when the view is referring to some
other thing. It's probably cleaner to make a clear distinction between the
two and stick with it throughout.
(I'm growing to dislike this "thing" terminology....)
__________________________________________________
Do You Yahoo!?
Yahoo! Health - Feel better, live better
http://health.yahoo.com