lxml / lxml-stubs

Type stubs for the lxml package
Other
43 stars 28 forks source link

_Attrib.get, mark the default argument as optional #95

Closed mr-c closed 10 months ago

scoder commented 1 year ago

Looks good.

scoder commented 1 year ago

Although, hang on – is that really needed? The argument has a default value, so it's clearly optional.

mr-c commented 1 year ago

Although, hang on – is that really needed? The argument has a default value, so it's clearly optional.

mypy versions after 0.600 does require explicit marking of optional inputs. Also, the stub doesn't currently list the default value so that couldn't be inferred anyhow.

https://mypy.readthedocs.io/en/stable/kinds_of_types.html#no-strict-optional has a (slightly confusing) explanation

scoder commented 10 months ago

Superseded by #97

mr-c commented 10 months ago

Thanks!