STINNER Victor <vstin...@python.org> added the comment:

> I don't understand what the problem is. _pyio.open is a function not a static 
> method.

The problem is that _pyio.open doesn't behave exactly as io.open when it's used 
to define a method:
---
#from io import open
from _pyio import open

class MyClass:
   my_open = open

MyClass().my_open("document.txt", "w")
---

This code currently fails with a TypeError, whereas it works with io.open.

The problem is that I failed to find a way to create a function in Python which 
behaves exactly as built-in functions like len() or io.open().

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue43682>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to