Proposed extension to file constructor

Taral taral at taral.net
Wed Jun 4 02:22:25 EDT 2003


On Tue, Jun 03, 2003 at 02:47:41PM -0500, Jeff Epler wrote:
> ... but maybe this is the natural interpretation of file(i) when
> isinstance(i, int).

Yes, I considered this, but there were sufficiently persuasive arguments
against in the sourceforge bug.

> ... and maybe the natural interpretation of file(f) when isinstance(f,
> int) is file(os.dup(f.fileno())) (assuming the above file(i) behavior)

I think you meant "when isinstance(f, file)". This is possible.

> ... and maybe the natural interpretation of file("-") is sys.stdin, and
> file("-", "w") is sys.stdout.

Yuk. What if I want a file called "-"?

-- 
Taral <taral at taral.net>
This message is digitally signed. Please PGP encrypt mail to me.
"Most parents have better things to do with their time than take care of
their children." -- Me
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-list/attachments/20030604/1f249295/attachment.sig>


More information about the Python-list mailing list