Apr-04-2019, 02:12 AM
Quote:I was just wondering if there is any reason that I should explicitly return False from a function instead of just letting it return None?In almost all cases, None can be treated the same as a Boolean. The one exception I can think of is in embedded code where the Boolean value is setting a register or toggling a GPIO port. There are certainly other instances.
You need to decide if it's needed or not for the application you are running. My guess is not.