On Jul 6, 8:27 am, Fabrizio Pollastri <pollas...@iriti.cnr.itwrote:
Hello,
it is possible to force in some way a write to a read-only attribute of
a python object? In which case?
Thanks for any answer.
F. Pollastri
What do you mean by read-only attribute?
If you are trying to change attributes of built-in objects, there is
no hope:
>>'astring'.upper = 2
---------------------------------------------------------------------------
exceptions.AttributeError
AttributeError: 'str' object attribute 'upper' is read-only
If the read-only attribute has been implemented via a property, there
is a way
to write it, but you should tell us more about your case.
Michele Simionato