Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Explore use of pathlib instead of os.path #58

Open
2 of 5 tasks
Pennycook opened this issue Feb 23, 2024 · 0 comments
Open
2 of 5 tasks

Explore use of pathlib instead of os.path #58

Pennycook opened this issue Feb 23, 2024 · 0 comments
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Milestone

Comments

@Pennycook
Copy link
Contributor

Feature/behavior summary

pathlib offers a higher-level abstraction of paths than os.path, including a Path object. Moving to pathlib would make the code cleaner, and would make it simpler for us to expose (via type-hints and docstrings) when certain functions expect paths.

Request attributes

  • Would this be a refactor of existing code?
  • Does this proposal require new package dependencies?
  • Would this change break backwards compatibility?

Related issues

N/A

Solution description

  • Migrate existing uses of os.path to pathlib
  • Update interfaces to accept Path or os.PathLike instead of str

Additional notes

If applied generally, I think this would break backwards compatibility -- some functions accepting strings should probably accept a Path (or os.PathLike).

@Pennycook Pennycook added documentation Improvements or additions to documentation enhancement New feature or request labels Feb 23, 2024
@Pennycook Pennycook added this to the 2.0.0 milestone Feb 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant