Skip to content

Refactor path handling to use pathlib.#99

Closed
jameshilliard wants to merge 2 commits intopypa:mainfrom
jameshilliard:pathlib
Closed

Refactor path handling to use pathlib.#99
jameshilliard wants to merge 2 commits intopypa:mainfrom
jameshilliard:pathlib

Conversation

@jameshilliard
Copy link
Copy Markdown

@jameshilliard jameshilliard commented Jan 25, 2022

This should help reduce the amount of special casing needed for windows paths.

@jameshilliard jameshilliard force-pushed the pathlib branch 11 times, most recently from 2281e9e to 0a74cb4 Compare January 25, 2022 17:18
@pradyunsg
Copy link
Copy Markdown
Member

Thanks for filing this!

I don't think there's much Windows-related special casing in this codebase and, overall, I think the code style that this PR introduces adds more complexity than it adds value in terms of clarity or ease of use. I'm going to close this, to reflect that I don't think this conversion is worthwhile.

@pradyunsg pradyunsg closed this Feb 17, 2022
@jameshilliard
Copy link
Copy Markdown
Author

I don't think there's much Windows-related special casing in this codebase and, overall, I think the code style that this PR introduces adds more complexity than it adds value in terms of clarity or ease of use.

I guess the main issue is that using os.path makes it rather difficult to reason about correctness since it's otherwise unclear what type of path(unix vs os style) the various codepaths actually expect to get passed. Is there a better way to make the path type demarcations clearer?

Isn't os.path generally not recommended to be used in favor of pathlib these days in general?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants