-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Suppress printing of function return #179
Comments
Can you say a bit more about how this function is used? If its only used by fire, you could just remove the return statement (since the return value isn't being used elsewhere anyway).
|
Essentially, this function is to be used as both API and CLI. Hence, I will need the function to return a list of dictionaries for use as API. However, as CLI, the printout of the returned list of dictionaries is ugly. Therefore, I am looking for a way to suppress the printing of returned values (list of dictionaries) when the function is used as CLI as I will use a set of print functions to print it nicely on the screen. |
Makes sense. What are the types of the values in your returned dictionary? It's on our list of TODOs to improve how dicts get printed. The current thinking is to leave the current method of printing dicts when the keys and values are all simple types, but to use the help screen (which is recently improved, and will come out in the next release) when the dict contains more complex types like functions, objects, etc. Would this solution help in your situation? |
We've moved forward w/ this approach (showing the help screen when a dict contains complex types) and it will be available in Friday's release. |
Having the same issue. Not ideal to see 'ugly' Is there any workaround? |
Same here - I started a decorator to check to see if the function is being called from Fire or somewhere else; any ideas on how to check that in a stable way? |
#345 will be available in the next release and may provide what you're looking for |
Let's say I have a Fire exposed function
def X(paramA):
return {'paramA': paramA}
Fire will automatically print out the function return to the screen. It is possible to suppress the printing of function return?
The text was updated successfully, but these errors were encountered: