Backwards-incompatible change made by making Vector2d immutable
In previous versions (before 43b18586), Vector2d was mutable.
A few packages relies on this behavior e.g. svg2tikz
.
With the change, the package would break.
I think one possible implementation is to rollback it and implement __complex__()
for ImmutableVector2d
.
Another alternative is that we can make ImmutableVector2d
inherit from complex
and Vector2d
contains a ImmutableVector2d
(instead of inherits from).
This would need a lot of boilerplate to copy the methods, but I think it's a reasonable tradeoff. (Of course it would breaks compatibility in some other way e.g. some package does instanceof(v, ImmutableVector2d)
)