[EDIT]
It is not important why I do want to have a dummy of writeable file-like object, but I would like to avoid unnecessary possibility of a memory leak io.StringIO
.
Is there any standard (preferably stl, but any widely accepted by the community will do) implementation of such object?
According to Does the same answer imply that the questions should be closed as duplicate? the question is not a duplicate of Suppress stdout / stderr print from Python functions as it is about a standard dummy object, not about the suppression of stderr
. Such object may be useful also for mocking
etc.
Indeed, one of the answers there (linking to NullDevice
) is compatible with my present solution.