> In 3.8, foo(a := 42) is in fact valid syntax, meaning the same as foo((a > := 42)). >
Yes, I ignored that assign operator is actually a valid syntax in function calling, and what I need is new syntax. Although the "dynamic return" could be implemented, I agree that it is unworthy and namedtuple or a class could solve the problem. Thanks for all your kind explanation. Let us close this conversation. Huang Y.W Greg Ewing <[email protected]> 于2019年8月27日周二 上午8:01写道: > HUANG YUWEI wrote: > > the number of return variables could be many. Then it would look like > > ``` > > res0, res1, res2, res3, res4, res5, res6, res7, ..., resN = > > high_level_function() > > At that point you're better off returning an object with named > attributes, such as a namedtuple or a class designed for the > purpose. > > -- > Greg > _______________________________________________ > Python-ideas mailing list -- [email protected] > To unsubscribe send an email to [email protected] > https://mail.python.org/mailman3/lists/python-ideas.python.org/ > Message archived at > https://mail.python.org/archives/list/[email protected]/message/2JOWUVLAH5SKE3ZOIAVA6R7SG2RKJQH2/ > Code of Conduct: http://python.org/psf/codeofconduct/ >
_______________________________________________ Python-ideas mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org/archives/list/[email protected]/message/KGWVRXGL2YI2RSZ34BNITCVXUOKI7JTF/ Code of Conduct: http://python.org/psf/codeofconduct/
