Like you said, return None
is (almost) never needed.
But you should consider that the intention of your code is much clearer with an explicit return None
. Remember: a piece of code also needs to be readable by human-beings, and being explicit usually helps.
More Related Contents:
- Trying to use a returned value without the other parts of a function [closed]
- How can I return two values from a function in Python?
- Is it pythonic for a function to return multiple values?
- Returning tuple with a single item from a function
- Python for in range()
- How are lambdas useful? [closed]
- Best way to return multiple values from a function? [closed]
- Apply function to each element of a list
- python max function using ‘key’ and lambda expression
- Why does Python code use len() function instead of a length method?
- Calling variable defined inside one function from another function
- Why do some functions have underscores “__” before and after the function name?
- Defining private module functions in python
- Difference between returns and printing in python? [duplicate]
- How to pass an operator to a python function?
- How can I pass information (a variable) out of a function? How can I use that from outside, e.g. in other functions?
- How do I pass variables across functions?
- How to make a local variable (inside a function) global [duplicate]
- Python passing list as argument
- How to pass dictionary items as function arguments in python? [duplicate]
- int([x[, base]]). Square brackets in functions in Python documentation? [duplicate]
- function is not defined error in Python
- Why is “None” printed after my function’s output?
- Is it possible to not return anything from a function in python?
- How to check if a variable is a function in Python?
- How to get the return value from a thread?
- How does Python return multiple values from a function?
- Is it possible to not return anything from a function in python? (What happens if the function reaches the end without `return`ing?)
- Use a string to call function in Python [duplicate]
- Are functions objects in Python?