Why are you trying to replicate move semantics in Python? The Python ownership model is entirely different from C++. In C++ terms, every Python object is like a shared_ptr<> (but with additional support for tracking and collecting reference cycles).
Generally, when a Python function wants to "take ownership" of a mutable object (say, to mutate it without the caller being surprised), it makes a copy of the object (e.g. dict.copy()). Regards Antoine. On Thu, 26 Nov 2020 17:34:52 -0000 "William Pickard" <lollol22...@gmail.com> wrote: > 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-le...@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/BATDZV2B3LNC6FO3RTUPNTKTB6DRP6BP/ > Code of Conduct: http://python.org/psf/codeofconduct/ > _______________________________________________ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-le...@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/7GHJS3L6T6EC75DTS7CKKO3S7U7YH4VZ/ Code of Conduct: http://python.org/psf/codeofconduct/