On 9/4/2012 6:18 PM, Chris Angelico wrote:
On Wed, Sep 5, 2012 at 5:16 AM, Terry Reedy <tjre...@udel.edu> wrote:
io.open depends on a function the returns an open file descriptor. opener
exposes that dependency so it can be replaced.

I skimmed the bug report comments but didn't find an answer to this:
Why not just monkey-patch?

As far as I know, one can only use normal Python code to monkey patch modules written in Python. Even then, one can only rebind names stored in writable dicts -- the module dict and class attribute dicts. The attributes of function code objects are readonly. Replacing a code object is not for the faint of heart.

io.py mostly loads _io compiled from C.


--
Terry Jan Reedy

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

Reply via email to