[ python-Feature Requests-1155485 ] file() on a file

SourceForge.net noreply at sourceforge.net
Thu Mar 3 00:48:53 CET 2005


Feature Requests item #1155485, was opened at 2005-03-02 23:48
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=355470&aid=1155485&group_id=5470

Category: Python Interpreter Core
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Felix Lee (felixlee)
Assigned to: Nobody/Anonymous (nobody)
Summary: file() on a file

Initial Comment:
it would be nice if file(f) worked when f is already a
file, either by returning f or by constructing a new
file that refers to the same thing.  that would make it
easy to write functions that can take either a file or
a filename as an argument, like so:
    def p(f): print list(file(f))
which is kind of like using int() as a cast operation.

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

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


More information about the Python-bugs-list mailing list