Hello, I've an issue with
def fun(x: bool = True):
"""This is my docstring.
Args:
x (bool, optional): some condition
"""
if x:
print("A")
print("B")
which gives a.py:fun:5: DAR103: ~x: expected bool but was bool, optional.
Remark that
def fun(x=True):
"""This is my docstring.
Args:
x (optional): some condition
"""
if x:
print("A")
print("B")
works fine, ie the problem seems to come from the : bool mypy hint.
Extra info:
% sw_vers
ProductName: macOS
ProductVersion: 11.6
BuildVersion: 20G165