[Python-3000] iostack and Oh Oh

Guido van Rossum guido at python.org
Wed Nov 29 22:45:05 CET 2006


I would not count on GFs, but I would suggest to count on ABCs and a
better hierarchy.

E.g. look at what Bill Janssen came up with (clearly incomplete):
http://wiki.python.org/moin/AbstractBaseClasses

I think that seekability should be a dynamically determined property though.

On 11/29/06, tomer filiba <tomerfiliba at gmail.com> wrote:
> Guido:
> > Agreed that for the distinction between readable/writable it's pretty
> > silly, and probably just encourages LBYL code
>
> no, the point was -- should we use separate StreamReader/StreamWriter
> classes, we wouldn't need this querying, the object will fail with
> AttributeError/TypeError if we attempt to perform an invalid operation.
>
> for example:
> f = file("...", "w")
> f.read() # IOError
>
> fr = FileWriter(file("...", "w"))
> fr.read() # AttributeError
>
> with all that stricter-interfaces talk, which is likely to enter py3k,
> the question we should ask is do we want the new IO stack to make
> use of those (or at least be designed with that in mind)?
>
> if we do want stricter interfaces in the IO stack too, then we
> should follow the java-style path (separate readers and writers,
> etc.).
>
> for example, do you think users of the IO stack would want multiple
> dispatch based on different streams? i'm well aware that GFs
> are not yet finalized material, but do we want to take them into
> account? or keep the plain old duck-typed io stack of today?
>
>
> -tomer
>


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


More information about the Python-3000 mailing list