lxml / lxml-stubs

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

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

Closed mr-c closed 10 months ago

scoder commented 11 months ago

Looks good.

scoder commented 11 months ago

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

mr-c commented 11 months 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!