operating system services meaning as with textiowrapper an instance of stringio supports all of the usual file operationsin addition to method getvalue(that returns the current contents of the memory buffer the open(function the io module defines the following open(functionwhich is the same as the builtin open(function in python open(file [mode [buffering [encoding [errors [newline [closefd]]]]]]opens file and returns an appropriate / object file is either string specifying the name of file or an integer file descriptor for an / stream that has already been opened the result of this function is one of the / classes defined in the io module depending on the settings of mode and buffering if mode is any of the text modes such as ' '' '' 'or ' 'then an instance of textiowrapper is returned if mode is binary mode such as 'rbor 'wb'then the result depends on the setting of buffering if buffering is then an instance of fileio is returned for performing raw unbuffered / if buffering is any other valuethen an instance of bufferreaderbufferedwriteror bufferedrandom is returned depending on the file mode the encodingerrorsand errors parameters are only applicable to files opened in text mode and passed to the textiowrapper constructor the closefd is only applicable if file is an integer descriptor and is passed to the fileio constructor abstract base classes the io module defines the following abstract base classes that can be used for type checking and defining new / classesabstract class description iobase rawiobase base class for all / classes base class for objects that support raw binary / inherits from iobase base class for objects that support buffered binary / inherits from iobase base class for objects that support text streams inherits from iobase bufferediobase textiobase it is rare for most programmers to work with these classes directly you should refer to the online documentation for details concerning their use and definition note the io module is new addition to pythonfirst appearing in python and backported to python as of this writingthe module is immature and has extremely poor runtime performance--especially for any application that involves heavy amounts of text / if you are using python you will be better served by the built-in open(function than using the / classes defined in the io module if you are using python there seems to be no other alternative although performance improvements are likely in future releasesthis layered approach to / coupled with unicode decoding is unlikely to match the raw / performance found in the standard librarywhich is the basis for / in python lib fl ff