Module relax_io :: Class DummyFileObject
[hide private]
[frames] | no frames]

Class DummyFileObject

source code

Instance Methods [hide private]
 
__init__(self)
Set up the dummy object to act as a file object.
source code
 
close(self)
A method for 'closing' this object.
source code
 
write(self, str)
Mimic the file object write() method so that this class can be used as a file object.
source code
list of str
readlines(self)
Mimic the file object readlines() method.
source code
Method Details [hide private]

write(self, str)

source code 

Mimic the file object write() method so that this class can be used as a file object.

Parameters:
  • str (str) - The string to be written.

readlines(self)

source code 

Mimic the file object readlines() method.

This method works even if this dummy file object is closed!

Returns: list of str
The contents of the file object separated by newline characters.