Re: [Python-Dev] file(file)

2007-01-13 Thread Georg Brandl
Terry Reedy schrieb: | We should also consider the semantics in more detail. Should the seek | position be shared between the two objects? What about buffering? | | That's definitely the hard part. But it's somewhat similar to | normal mutable objects which are (I think always, right?)

Re: [Python-Dev] file(file)

2007-01-13 Thread Giovanni Bajo
On 13/01/2007 1.37, Brett Cannon wrote: For security reasons I might be asking for file's constructor to be removed from the type for Python source code at some point (it can be relocated to an extension module if desired). Isn't there the wrong list then? I can't see how this can ever

[Python-Dev] file(file)

2007-01-12 Thread A.M. Kuchling
Forwarded for discussion from http://www.python.org/sf/1633665. --amk [forwarded from http://bugs.debian.org/327060] Many types in Python are idempotent, so that int(1) works as expected, float(2.34)==2.34, ''.join('hello')=='hello' et cetera. Why not file()? Currently, file(open(something,

Re: [Python-Dev] file(file)

2007-01-12 Thread Guido van Rossum
On 1/12/07, A.M. Kuchling [EMAIL PROTECTED] wrote: Forwarded for discussion from http://www.python.org/sf/1633665. --amk [forwarded from http://bugs.debian.org/327060] Many types in Python are idempotent, so that int(1) works as expected, float(2.34)==2.34, ''.join('hello')=='hello' et

Re: [Python-Dev] file(file)

2007-01-12 Thread Jack Jansen
On 12-Jan-2007, at 19:01 , Guido van Rossum wrote: On 1/12/07, A.M. Kuchling [EMAIL PROTECTED] wrote: Many types in Python are idempotent, so that int(1) works as expected, float(2.34)==2.34, ''.join('hello')=='hello' et cetera. I'm not sure I understand the use case; I don't believe I've

Re: [Python-Dev] file(file)

2007-01-12 Thread Brett Cannon
On 1/12/07, A.M. Kuchling [EMAIL PROTECTED] wrote: Forwarded for discussion from http://www.python.org/sf/1633665. --amk [forwarded from http://bugs.debian.org/327060] Many types in Python are idempotent, so that int(1) works as expected, float(2.34)==2.34, ''.join('hello')=='hello' et

Re: [Python-Dev] file(file)

2007-01-12 Thread glyph
On 12:37 am, [EMAIL PROTECTED] wrote: For security reasons I might be asking for file's constructor to be removed from the type for Python source code at some point (it can be relocated to an extension module if desired). By forcing people to go through open() to create a file object you can

Re: [Python-Dev] file(file)

2007-01-12 Thread Brett Cannon
On 1/12/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: On 12:37 am, [EMAIL PROTECTED] wrote: For security reasons I might be asking for file's constructor to be removed from the type for Python source code at some point (it can be relocated to an extension module if desired). By forcing

Re: [Python-Dev] file(file)

2007-01-12 Thread glyph
On 02:42 am, [EMAIL PROTECTED] wrote: Wrapper around open() that does proper checking of its arguments. I will be discussing my security stuff at PyCon if you are attending and are interested. I am both, so I guess I'll see you there :). ___

Re: [Python-Dev] file(file)

2007-01-12 Thread Terry Reedy
Jack Jansen [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] | | On 12-Jan-2007, at 19:01 , Guido van Rossum wrote: | | On 1/12/07, A.M. Kuchling [EMAIL PROTECTED] wrote: | Many types in Python are idempotent, so that int(1) works | as expected, float(2.34)==2.34,