type of path parameter in pkgutil.iter_modules #13636
Labels
help wanted
An actionable problem of low to medium complexity where a PR would be very welcome
stubs: false positive
Type checkers report false errors
Discussed in python/typing#1946
Originally posted by maarten-vandenberg March 17, 2025
I'm not sure whether this is the right place to ask the following question. If not, I'd be happy to ask it and/or look elsewhere! I could not find an answer searching this forum or typeshed issues, however a related issue might be #6650.
The
path
parameter inpkgutil.iter_modules
is typed asIterable[str]
. Howeveriter_modules
also accepts apathlib.Path
, which seems consistent with the call toos.fsdecode
inget_importer
(acceptingPathLike
). Am I missing something in how this is typed or is this somehow inconsistent?The text was updated successfully, but these errors were encountered: