About 6,210,000 results
Open links in new tab
  1. What does -> mean in Python function definitions? - Stack Overflow

    Jan 17, 2013 · 13 def f(x) -> 123: return x My summary: Simply -> is introduced to get developers to optionally specify the return type of the function. See Python Enhancement Proposal 3107 …

  2. How can I return two values from a function in Python?

    I would like to return two values from a function in two separate variables. What would you expect it to look like on the calling end? You can't write a = select_choice(); b = select_choice() …

  3. python - Error: Invalid Syntax on "def" - Stack Overflow

    Jan 16, 2014 · Error: Invalid Syntax on "def" Asked 14 years, 3 months ago Modified 11 years, 9 months ago Viewed 31k times

  4. python - What does def main () -> None do? - Stack Overflow

    As is, it does absolutely nothing. It is a type annotation for the main function that simply states that this function returns None. Type annotations were introduced in Python 3.5 and are specified …

  5. Groovy: what's the purpose of "def" in "def x = 0"?

    Oct 9, 2008 · Using the def keyword in larger programs is important as it helps define the scope in which the variable can be found and can help preserve encapsulation. If you define a method …

  6. function - what is "def" in Java class - Stack Overflow

    Jan 14, 2021 · while googling, I find that "def" is used in python and groovy language. But, I am using java. So, how come it is possible to use keywords like "def" in java class? Is it possible …

  7. windows - Linking : .a, .lib and .def files - Stack Overflow

    For load-time loading, I seem to be only needing the dll file : no .a, .lib or .def file is needed. I wondered what these file format represent and what purpose do they serve. What I know and …

  8. Using len () and def __len__ (self): to build a class

    Feb 27, 2013 · Just curious, Is there any difference (advantages and disadvantages) between using len () or def __len__ () when I build a class? And which is the best Python style? class …

  9. .def files C/C++ DLLs - Stack Overflow

    Jul 21, 2014 · The advantage of def file is that, it helps you to maintain the backword compatibility with the already realsed dlls. i.e it maintains the ordinal numbers for apis. Suppose you add a …

  10. python - Why do some functions have underscores - Stack Overflow

    May 24, 2024 · The other respondents are correct in describing the double leading and trailing underscores as a naming convention for "special" or "magic" methods. While you can call …