About 99,900 results
Open links in new tab
  1. Python void return type annotation - Stack Overflow

    In python 3.x, it is common to use return type annotation of a function, such as: def foo () -> str: return "bar" What is the correct annotation for the "void" type?

  2. python: return, return None, and no return at all -- is there any ...

    Often in Python, functions which return None are used like void functions in C -- Their purpose is generally to operate on the input arguments in place (unless you're using global data (shudders)).

  3. NoReturn vs. None in "void" functions - type annotations in Python 3.6

    Python 3.6 supports type annotation, like: def foo() -> int: return 42 But what is expected to use when a function hasn't return anything? [PEP484] 1 examples mostly use None as a return ty...

  4. Is there anything like a "void lambda" in Python?

    Jun 5, 2014 · The contents of a lambda function must be a single expression; no statements are allowed. Moreover, print is a statement in Python 2.x. This means that you cannot use it inside a …

  5. How can i test a void function in python using pytest?

    Nov 25, 2022 · 0 I just started unit testing in python using pytest. Well, when I have a function with a return value, with the "assert" I can compare a certain value with the value that the function return. …

  6. What is the best way to exit a function (which has no return value) in ...

    What is the best way to exit a function (which has no return value) in python before the function ends (e.g. a check fails)? [duplicate] Asked 14 years, 6 months ago Modified 4 years, 11 months ago …

  7. language agnostic - Def, Void, Function? - Stack Overflow

    Nov 6, 2009 · I love Python, and Guido's a friend, but def is just the worst keyword in the language!-) As pointed out, void is a return type and not a keyword to mark a function as def is. def seems to me to …

  8. function - How and why do void methods become void in Python?

    Nov 27, 2022 · 0 functions in python don't return void, it's a common practice that functions which modify their inputs return None which is a python object, note the following function.

  9. Difference between void methods and return methods?

    Dec 11, 2021 · In public static int, the int means that this function is going to return an int value. However, in public static void, your function is not going to return any value, so its return type is void. …

  10. Python's Equivalent of "public static void main" - Stack Overflow

    May 25, 2010 · I consider it a language design flaw that one must learn 1. main as an entry point, 2. public method protection, 3. static method definitions, 4. void to indicate a function with no return, …