On Mon, 24 Aug 2015, Volker Braun wrote:
What would be the benefit over
M2 = M**2
M2.set_immutable()
other than a more cumbersome syntax that requires you to look up the
__mul__ docstring to use it?
Speed? I don't know, this is a real question.
I just thinked about difference between matrices, graphs and posets. For
matrices we have the set_immutable() function. Posets are always
immutable. Graphs can be made immutable at creation time, and a copy() can
return a mutable graph from immutable (or immutable from mutable). Would
we gain anything if - for example - cartesian_product() would have a
immutable-option?
--
Jori Mäntysalo