[issue45991] Improve ambiguous docstrings in pkgutil

2022-02-28 Thread Stanley
Stanley added the comment: I feel like there might be some backwards compatibility issues if pkgutil wraps it like that, but similarly I'm not at all familiar with how common the package is used and whether it'd be fine to make that change, so I'll also differ judgement here. --

[issue45991] Improve ambiguous docstrings in pkgutil

2022-02-28 Thread Kevin Hock
Kevin Hock added the comment: > Maybe instead a note could be put in the Pathlib doc noting functions that > accept path arguments might not accept Path objects? My concern with that is that someone using `pkgutil` wouldn't see it. However, I can see the argument that fixing the 'source' is

[issue45991] Improve ambiguous docstrings in pkgutil

2022-02-25 Thread Barney Gale
Barney Gale added the comment: Should pkgutil call os.fspath() in this case? -- nosy: +barneygale ___ Python tracker ___ ___

[issue45991] Improve ambiguous docstrings in pkgutil

2022-02-24 Thread Stanley
Stanley added the comment: While it is ambiguous, when there's a path parameter I would default it to string unless otherwise specified. Maybe instead a note could be put in the Pathlib doc noting functions that accept path arguments might not accept Path objects? --

[issue45991] Improve ambiguous docstrings in pkgutil

2022-02-24 Thread Kevin Hock
Kevin Hock added the comment: At best it is ambiguous, with the class being confused with Str being called Path. Looking up "AttributeError: 'PosixPath' object has no attribute 'startswith'" gives a lot of results for similar issues, so I think the wording could be improved. --

[issue45991] Improve ambiguous docstrings in pkgutil

2022-02-23 Thread Stanley
Stanley added the comment: Could you expand a bit on why 'list of paths' in pkgutil is understood by default to be 'list of PosixPath paths'? I would interpret it by default to be string paths if I saw it somewhere without context -- nosy: +slateny

[issue45991] Improve ambiguous docstrings in pkgutil

2022-01-14 Thread Irit Katriel
Change by Irit Katriel : -- keywords: +easy versions: -Python 3.6, Python 3.7, Python 3.8 ___ Python tracker ___ ___

[issue45991] Improve ambiguous docstrings in pkgutil

2021-12-05 Thread Kevin Hock
New submission from Kevin Hock : # Issue If you search for "list of paths" in https://github.com/KevinHock/cpython/blob/main/Lib/pkgutil.py A lot of people mistake this as `PosixPath`. You can see an example here: https://github.com/duo-labs/parliament/pull/207 that references other OSS