This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients Mark.Shannon, mark.dickinson, vstinner
Date 2021-03-31.14:50:45
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
> I don't understand what the problem is. is a function not a static method.

The problem is that doesn't behave exactly as 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

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
Date User Action Args
2021-03-31 14:50:45vstinnersetrecipients: + vstinner, mark.dickinson, Mark.Shannon
2021-03-31 14:50:45vstinnersetmessageid: <>
2021-03-31 14:50:45vstinnerlinkissue43682 messages
2021-03-31 14:50:45vstinnercreate