[Python-3000] iostack, continued

Giovanni Bajo rasky at develer.com
Wed Jun 7 11:37:39 CEST 2006


Greg Ewing <greg.ewing at canterbury.ac.nz> 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 meaningless without a definition of what counts as a
> "side effect". Writing to a property must have *some* effect
> on the state of something, otherwise it's pointless.
>
> 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 underlying file descriptor?
> If it does, then file.position = foo is a legitimate usage
> of a property.


I believe what he meant was that property change should not affect the state of
anything but the *Python*'s object.

Giovanni Bajo



More information about the Python-3000 mailing list