mirror of
https://github.com/zulip/zulip.git
synced 2025-10-25 09:03:57 +00:00
python: Fix misuse of Optional types for optional parameters.
There seems to have been a confusion between two different uses of the word “optional”: • An optional parameter may be omitted and replaced with a default value. • An Optional type has None as a possible value. Sometimes an optional parameter has a default value of None, or None is otherwise a meaningful value to provide, in which case it makes sense for the optional parameter to have an Optional type. But in other cases, optional parameters should not have Optional type. Fix them. Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
committed by
Tim Abbott
parent
7229088b6c
commit
69c0959f34
@@ -313,7 +313,7 @@ def init_worker(counter: Synchronized) -> None:
|
||||
print("*** Upload directory not found.")
|
||||
|
||||
class TestSuite(unittest.TestSuite):
|
||||
def run(self, result: TestResult, debug: Optional[bool]=False) -> TestResult:
|
||||
def run(self, result: TestResult, debug: bool=False) -> TestResult:
|
||||
"""
|
||||
This function mostly contains the code from
|
||||
unittest.TestSuite.run. The need to override this function
|
||||
|
||||
Reference in New Issue
Block a user