Return a deepcopy of the `Path`. The `Path` will not be readonly, even if the source `Path` is.
(self, memo)
| 276 | return copy.copy(self) |
| 277 | |
| 278 | def __deepcopy__(self, memo): |
| 279 | """ |
| 280 | Return a deepcopy of the `Path`. The `Path` will not be |
| 281 | readonly, even if the source `Path` is. |
| 282 | """ |
| 283 | # Deepcopying arrays (vertices, codes) strips the writeable=False flag. |
| 284 | cls = type(self) |
| 285 | memo[id(self)] = p = cls.__new__(cls) |
| 286 | |
| 287 | for k, v in self.__dict__.items(): |
| 288 | setattr(p, k, copy.deepcopy(v, memo)) |
| 289 | |
| 290 | p._readonly = False |
| 291 | return p |
| 292 | |
| 293 | def deepcopy(self, memo=None): |
| 294 | """ |