Ben Finney <ben+pyt...@benfinney.id.au> writes:

> Steven D'Aprano <st...@pearwood.info> writes:
>
> > but how do I tell open() to use MyFile?
>
> I haven't used it, but does the ‘opener’ parameter do what you want?

No, it doesn't; the ‘opener’ parameter doesn't have any say in the type
of object returned from ‘open’.

It seems the existing ‘open’ implementation doesn't allow you to
override the type of object returned. You may have to resort to
monkey-patching the ‘io’ attributes to put your preferred classes there.

-- 
 \       “Science shows that belief in God is not only obsolete. It is |
  `\                        also incoherent.” —Victor J. Stenger, 2001 |
_o__)                                                                  |
Ben Finney

-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to