Is object mutable? Determine programmatically.

Tom nospam at nospam.com
Wed Sep 6 10:49:49 EDT 2000


I have a Python Object, and I want to determine if it is mutable.

I could change a reference to it and see if the reference's id changes, but
I don't know how to change an object of unknown type (ie. come up with a new
value of the same type).  And I guess that the rules for changes in identity
are implementation specific anyway.

Any ideas?

Tom.





More information about the Python-list mailing list