Is is possible to subclass python’s built-in open? I am intermittently getting the following error:
class Open(open):
pass
x = mymodule.Open()
TypeError: Error when calling the metaclass bases
cannot create ‘builtin_function_or_method’ instances
The
The
openis not a class, it is a function. However, thefileobject is a type that you can subclass.