Can I run an operation on an object's attribute when reading?

Bruno Desthuilliers bdesth.quelquechose at
Mon Jan 19 20:05:59 CET 2009

Steven D'Aprano a écrit :

> When all you have is a hammer, everything looks like a nail... Why do you 
> have to read item.tags directly? Just write a function and call it 
> instead of direct attribute access.

A sensible advice, but only relevant if this class instances are only 
used by code the OP do control. Which may or not be the case.

More information about the Python-list mailing list