Re: [Python-3000] iostack, continued

2006-06-07 Thread Greg Ewing
Nick Coghlan wrote: > With a position attribute on actual file IO objects, it should be > possible to set it up so that the file object only invokes tell() when > you try to *change* the position. When you simply access the attribute, > it will return the answer from an internal variable (it ne

Re: [Python-3000] iostack, continued

2006-06-07 Thread Greg Ewing
Giovanni Bajo wrote: > I believe what he meant was that property change should not affect the state > of > anything but the *Python*'s object. Then what counts as part of the Python object? If the object is wrapping a C struct from some library, is it okay for a property to change a member of th

Re: [Python-3000] iostack, continued

2006-06-07 Thread Terry Reedy
"tomer filiba" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > instead of doing > if not s.getsockopt(SOL_SOCK, SOCK_REBINDADDR): >s.setsockopt(SOL_SOCK, SOCK_REBINDADDR, 1) > > you can just do > if not s.rebind_addr: >s.rebind_addr = True > > which is much easier (both to m

Re: [Python-3000] iostack, continued

2006-06-07 Thread tomer filiba
> I believe what he meant was that property change should not affect the state > of > anything but the *Python*'s object. for reference, in sock2 i use properties to change the socket options of sockets. instead of doing if not s.getsockopt(SOL_SOCK, SOCK_REBINDADDR): s.setsockopt(SOL_SOCK,

Re: [Python-3000] String formatting: Conversion specifiers

2006-06-07 Thread Christian Tanzer
Nick Coghlan <[EMAIL PROTECTED]> wrote: > Bill Janssen wrote: > >> Here is a list of the conversion types that are currently supported by > >> the % operator. First thing you notice is an eerie similarity between > >> this and the documentation for 'sprintf'. :) > > > > Yes. This is (or was) a s

Re: [Python-3000] iostack, continued

2006-06-07 Thread Nick Coghlan
Giovanni Bajo wrote: > Greg Ewing <[EMAIL PROTECTED]> wrote: >> I'm guessing he meant it shouldn't affect the state of anything >> outside that object. But then we need to decide what counts >> as part of the state of a file object. Does it include the >> value of the file position of the underlyin

Re: [Python-3000] String formatting: Conversion specifiers

2006-06-07 Thread Nick Coghlan
Bill Janssen wrote: >> Here is a list of the conversion types that are currently supported by >> the % operator. First thing you notice is an eerie similarity between >> this and the documentation for 'sprintf'. :) > > Yes. This is (or was) a significant advantage to the system. Many > people

Re: [Python-3000] String formatting: Conversion specifiers

2006-06-07 Thread Nick Coghlan
Talin wrote: > I've taken your proposal as a base, and made some additional changes to > it. In addition, I've gone ahead and implemented a prototype of the > built-in formatter based on the revised text. I like it! As for somewhere to put the prototype, a patch or RFE tracker item isn't too b

Re: [Python-3000] iostack, continued

2006-06-07 Thread Giovanni Bajo
Greg Ewing <[EMAIL PROTECTED]> wrote: >> About this part: "properties raising IOError", I would like to >> remember that Guido pronounced on The Way properties should be used >> in Py3k. Part of the pronouncement was that reading/writing >> properties should never have side-effects. > > That's me