On 02/06/2017 01:11, Steven D'Aprano wrote:
Hi Joannah, and welcome!

On Thu, Jun 01, 2017 at 05:17:49PM +0300, joannah nanjekye wrote:

[...]
My proposal is we provide a way of functions returning multiple values.
This has been implemented in languages like Go and I have found many cases
where I needed and used such a functionality. I wish for this convenience
in python so that I don't  have to suffer going around a tuple.

Can you explain how Go's multiple return values differ from Python's?
Looking at the example here:

https://golang.org/doc/effective_go.html

it looks like there's very little difference. In Go, you have to declare
the return type(s) of the function, which Python doesn't require, but
the caller treats the function the same.


I suggest you look up the Go reflect package and the use of interface{}, meaning that you can pass anything you like both into and out of a function. There lies The Road To Hell as far as I'm concerned, I'll stick with duck typing thank you.

--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.

Mark Lawrence

_______________________________________________
Python-ideas mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to