Top "Return" questions

A return statement causes execution to leave the current subroutine and resume at the point in the code immediately after where the subroutine was called, known as its return address.

Try-with-resources and return statements in java

I'm wondering if putting a return statement inside a try-with-resources block prevents the resource to be automatically closed. try(Connection …

java return try-with-resources
Docstrings when nothing is returned

What is the docstring convention when a function doesn't return anything? For example: def f(x): """Prints the element given …

python function return docstring
Why does Rust not have a return value in the main function, and how to return a value anyway?

In Rust the main function is defined like this: fn main() { } This function does not allow for a return value …

return main rust
`return` in Ruby Array#map

I have a method where I would like to decide what to return within a map function. I am aware …

arrays ruby return enumerator
Python 'return not' statement in subprocess returncode

I just came across a very strange line of code in Python: .... self.myReturnCode = externalProcessPopen.returncode .... .... return not self.myReturnCode .... …

python return subprocess popen return-code
Function that returns map in c++

Can someone please give an actual example of function that returns map in c++. I tried answers from other posts …

c++ function return stdmap cpprest-sdk
Return two values in Robot Framework

Is there a possibility to return two variables in Robot Framework? ${result1}, ${result2}= MyKeyword doesn't work.

function variables return automated-tests robotframework
Does std::cout have a return value?

I am curious if std::cout has a return value, because when I do this: cout << cout <&…

c++ return cout
What's the Best Way to Catch the Return Key in a PasswordBox? (WPF/XAML)

What's the best way to catch the return key in a PasswordBox? (WPF/XAML) I have a TextBox field and …

wpf xaml .net-3.5 return passwordbox
How to return a copy of an array?

public void addStudent(String student) { String [] temp = new String[students.length * 2]; for(int i = 0; i < students.length; i++){ temp[…

java arrays return training-data