In article <[EMAIL PROTECTED]>, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote:
> Lou Pecora schrieb: [cut] > > > > Then do something like (I know this isn't right, I'm just trying to > > convey the idea of what I would like) > > > > mf=myfile() > > > > mf=open("Afile","r") > > Possible in some way? Thanks in advance for any clues. > > Nope, not in that way. But you might consider writing a proxy/wrapper > for an object. That looks like this (rouch sketch from head): > > class FileWrapper(object): > def __init__(self, f): > self._f = f > > def __getattr__(self, name): > return getattr(self._f, name) > > def myreadline(self): > .... > > Then you do > > f = FileWrapper(open(name, mode)) > > Diez Interesting. I have to think about this to understand if it is a solution I can use. But, thank you for a very different angle on this. -- Lou Pecora (my views are my own) REMOVE THIS to email me. -- http://mail.python.org/mailman/listinfo/python-list