__all__
in a stub will easily go out of date
#7284
Labels
project: policy
Organization of the typeshed project
__all__
in a stub will easily go out of date
#7284
Stubtest does not check that the elements in a stub file's
__all__
match the elements in the runtime's__all__
. It's also not obvious (to me, at least) how stubtest could be patched so that it would check that the elements match.If
__all__
is a tuple, stubtest will raise an error if the stub's__all__
is a different length to the runtime's__all__
, but it will not raise an equivalent error if__all__
is a list.flake8 will raise an error if a name in
__all__
is not defined in the file. flake8-pyi on master (not yet released) will also raise an error if__all__
is merely annotated aslist[str]
without being defined. But flake8 will not raise an error if a name is missing from__all__
.All this means that the
__all__
definitions in typeshed are liable to become outdated very easily if new elements are added to__all__
in future Python versions. I'm not sure exactly what the solution is.The text was updated successfully, but these errors were encountered: