Returning `Path` instead of `str` instances
See original GitHub issueAs mentioned in https://github.com/ActiveState/appdirs/issues/79, I’ve been working on another fork of appdirs
, but would rather hold off on publishing that and focus all efforts in one place.
I mostly have two changes in places:
- Drop support for ancient python versions (there’s little point in a new library supporting Pythons that re long past their EOL, and that just holds back on keeping the library alive).
- Change the return type of directories to
Path
instance, to make usage on consumer libraries easier. This kinda means it’s not a 100% drop-in replacement, but rather an upgrade (e.g.: like a major).
Maybe it would make sense to have a platformdirs==1.0.0
release, which is functionally identical to appdirs
(to allow seamless switching), and then start merging in any non-backwards-compatible changes. Thoughts?
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:23 (22 by maintainers)
Top Results From Across the Web
Convert a str to path type? - python - Stack Overflow
The code is expecting that the file path is returned from a pygtk browser window (via another function). I want to call the...
Read more >click.Path returns str, not pathlib.Path · Issue #405 · pallets/click
We just add click.PATH and use it in examples instead of click.Path , therefore encouraging click.PATH without breaking changes. This would be less ......
Read more >Path Operations - Essential Java Classes - Oracle Help Center
If the Path is relative, it returns an absolute path. If the Path contains any redundant elements, it returns a path with those...
Read more >Best Practice: Working with Paths in Python - Part 1 - b.telligent
Solution 1 – the hideous variant. Simply avoid the Windows separator and instead write the path using Linux separators only: path_dir: str = ......
Read more >pathlib — Object-oriented filesystem paths — Python 3.11.1 ...
Pure paths are useful in some special cases; for example: ... PathLike interface which returns a string, or another path object:.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
And yes.
Done by #27.