| 15 | |

| 16 | So here is now the current behavior: |

| 17 | {{{ |

| 18 | sage: MM = MatrixSpace(ZZ, 3,3) |

| 19 | sage: MM(0).is_mutable() |

| 20 | True |

| 21 | sage: MM.zero_matrix().is_mutable() |

| 22 | False |

| 23 | sage: MM(1).is_mutable() |

| 24 | True |

| 25 | sage: MM.identity_matrix().is_mutable() |

| 26 | False |

| 27 | }}} |

| 28 | Note that calling {{{MM(0)}}} or {{{MM(1)}}} is a bad idea: |

| 29 | {{{ |

| 30 | sage: timeit("MM(0)") |

| 31 | 625 loops, best of 3: 72.4 µs per loop |

| 32 | sage: timeit("copy(MM.zero_matrix())") |

| 33 | 625 loops, best of 3: 15.6 µs per loop |

| 34 | }}} |

| 35 | And for identity: |

| 36 | {{{ |

| 37 | sage: timeit("MM(1)") |

| 38 | 625 loops, best of 3: 67.4 µs per loop |

| 39 | sage: timeit("copy(MM.identity_matrix())") |

| 40 | 625 loops, best of 3: 41.1 µs per loop |

| 41 | }}} |