In the Python 2.x was simple to create own file object: class MyFile(file): pass for example to reimplement write() or something else. How to do it in Python 3.x?