Steve said:

"(This isn't Java or Ruby, where data-hiding is compulsory :-)  "

At the risk of striking a sessile equine, when the attribute shouldn't be 
modified directly by client code, then you hide it and use a property to allow 
client code access. It is the idiom of allowing client code to edit read-write 
data directly via attributes that is pythonic, even though discouraged 
(somewhat) in other languages. 

Actually C# is mature enough for this idiom. C# and Python both support 
getter/setter methods that present as direct attribute access to client code, 
and thus allow you to refactor the class without breaking backwards 
compatibility.

-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to