Does Python really follow its philosophy of "Readability counts"?

Terry Reedy tjreedy at udel.edu
Tue Jan 20 23:16:24 EST 2009


Delaney, Timothy (Tim) wrote:
> Terry Reedy wrote:
> 
>>> The compiled code differs.
>> I *strongly* doubt that.  Properties are designed to be transparent to
>> user code that access atrributes through the usual dotted name
>> notation precisely so that class code can be changed from
>>    x = ob
>> to
>>    x = property(get_x, set_x, del_x)
>> without changing user code.
> 
> He was talking about C# with that statement. In C#, the compiled code
> differs depending on whether you use a property or an attribute. Or at
> least that's how I interpreted it.

Checking back, I see now that Luis Z. went from Python
"It boggles me when I see python code with properties that only set and
get the attribute, or even worse, getters and setters for that
purpose. " to C#, and that Duncan was seemingly responding to the C# 
part.  If C# is like that, how inconvenient.

> You are of course correct as to how Python does it.

I guess I am spoiled ;-).

tjr




More information about the Python-list mailing list