[Python-bugs-list] [ python-Bugs-784509 ] interpret string argument as filename

SourceForge.net noreply at sourceforge.net
Wed Aug 6 19:19:13 EDT 2003


Bugs item #784509, was opened at 2003-08-06 18:19
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=784509&group_id=5470

Category: Extension Modules
Group: Feature Request
Status: Open
Resolution: None
Priority: 5
Submitted By: Russ Thompson (russt)
Assigned to: Nobody/Anonymous (nobody)
Summary: interpret string argument as filename

Initial Comment:

I think it would be great if, in general, anywhere
a python function asks for a file object, supplying
a string would be interpreted as a filename.

For example, one can do:
cPickle.dump('mypicklefile', myobject)

instead of:
f=file('mypicklefile','w')
cPickle.dump(f,myobject)
f.close()

Much faster in an interactive session!  And very
easy to implement.  And similarly for cPickle.load()
and lots of other functions.  Pickling of multiple
objects could still be accomplished through the
long form above.

Thanks,
-Russ





----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=784509&group_id=5470



More information about the Python-bugs-list mailing list