Python Forum
special results from calling a function - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: General (https://python-forum.io/forum-1.html)
+--- Forum: News and Discussions (https://python-forum.io/forum-31.html)
+--- Thread: special results from calling a function (/thread-27657.html)



special results from calling a function - Skaperen - Jun-15-2020

it's certainly possible to get multiple answers from a called function by having it return a dictionary. but what about an extra, special, result in addition to the main result, while the main result might already be commonly used before this extra result is being implemented and used deep in the middle of a big expression.

long before i encountered Python i had been designing my own language. i still think along those lines when i encounter various issues. i had an idea in that language where a kind of keyword argument could be used for that. i did this in C a lot with "store-back pointers". it might be done with : instead of = in the argument list. there would need to be something special in the function code, too. but, my thinking didn't go that far.

i just added a keyword to pass a dictionary to store all the extra results into. simple enough.