making objects unassignable "read-only" (especially when extending)

Simon Brunning simon at brunningonline.net
Wed Jan 18 07:05:10 EST 2006


On 18 Jan 2006 11:59:23 GMT, Johannes Zellner <johannes at zellner.org> wrote:
> Hi,
>
> can I make an object read-only, so that
>
>     x = new_value
>
> fails (and x keeps it's orginal value)?

This works for me:

http://groups.google.com/group/comp.lang.python/msg/2b1785397358ff90

--
Cheers,
Simon B,
simon at brunningonline.net,
http://www.brunningonline.net/simon/blog/



More information about the Python-list mailing list