Actually, you really can't:

    alakazam@thrawn ~ ⇾ python
    Python 2.7.6 (default, Nov 14 2013, 14:05:18) 
    [GCC 4.2.1 Compatible Apple LLVM 5.0 (clang-500.2.79)] on darwin
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import StringIO
    >>> StringIO.StringIO
    <class StringIO.StringIO at 0x103567940>
    >>> StringIO.StringIO('foobar')
    <StringIO.StringIO instance at 0x10358d758>
    >>> print StringIO.StringIO('foobar')
    <StringIO.StringIO instance at 0x10358d7a0>
    >>> print str(StringIO.StringIO('foobar'))
    <StringIO.StringIO instance at 0x10358d7a0>