26.11.20 13:44, 3mi...@gmail.com пише: > Add something like Move type hint to typing module. It will tell the analyzer > that the input parameter of the function is moved and can not be used after. > For example: > ``` > def f(d: Move[dict]) -> dict: > d['a'] = 2 > return d > > d = {1: 2} > f(d) > print(d[1]) # mistake, using of moved value
See also discussion "add a list.swap() method" https://mail.python.org/archives/list/python-ideas@python.org/thread/WIBV45JPFBSMCKMFNNQPQWIHNR6LLAEU/ That proposition was not passed, but if that feature be added, it would need a type annotation proposed in this thread. _______________________________________________ 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/SHT5GNBIRMQ6C5OFKUGK3C2A6BBV3QCP/ Code of Conduct: http://python.org/psf/codeofconduct/