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 <[EMAIL PROTECTED]> 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/) _______________________________________________ Python-3000 mailing list Python-3000@python.org http://mail.python.org/mailman/listinfo/python-3000 Unsubscribe: http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com