File-like objects name attribute.

Skip Montanaro skip at pobox.com
Sun Jan 5 13:56:56 EST 2003


    noah> What does the form "<...>" mean? Does this mean I should include <
    noah> > around the name for my file-like object? 

Yes, generally if you have an object whose source would normally be a file
but is a string, you name it "<string>", e.g.:

    >>> compile('x=1', '<string>', 'single')
    <code object ? at 0x4090e0, file "<string>", line 1>

-- 
Skip Montanaro - skip at pobox.com
http://www.musi-cal.com/
http://www.mojam.com/





More information about the Python-list mailing list