All,
Most of rust is based around the idea of move semantics.
It's really useful in cases wherever you want the object to be mutable,
want to avoid side effects from something else still having a reference
unintentionally, and avoid a lot of deep copies of the underlying resources.
On the project I work on (rubin observatory) we created something that lets
us somewhat emulate this in python and it has been useful for debugging and
some safety.
We used it on a method-chaining interface on query objects; it comes up
when you have a system where you want to convert one complex object into a
slightly different complex object, and you could do that more efficiently
when you know the original doesn't need to exist anymore - e.g. by taking
an internal list and appending to it, rather than copying the whole thing
and then appending.
On Thu, Nov 26, 2020, 12:35 PM William Pickard
C++ has official move syntax via the R-Value Reference (&&). C#/.NET is the only other language I know of where it can be emulated (via Constructors/Assignment operators).
I'm not fluent in Perl and Ruby to try to guess if they can support it or not. _______________________________________________ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-leave@python.org https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org/archives/list/python-ideas@python.org/message/BATDZV... Code of Conduct: http://python.org/psf/codeofconduct/