-
Notifications
You must be signed in to change notification settings - Fork 557
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
use pathlib.Path to represent file system paths instead of strings #1534
Comments
@Aayush-Goel-04 are you interested in taking a stab at this? we'll want to replace any uses of os.path with pathlib. |
Yes, will give it a try. |
@williballenthin |
yeah let's prefer to use pathlib where possible, so that means path.unlink. |
@williballenthin |
we should try to work with pathlib as much as possible. we'll want to convert from str to pathlib.Path as soon as possible, and convert back to str only when we're about to render it to a user. |
Hey @williballenthin , |
please propose something that makes sense to you and we can discuss. i think it just needs to be sensible; i don't think we have to be too strict with these types, but it's something to try for. for example, it's ok to use str with argparse right when the CLI args come in. we'd just want to convert to pathlib before any other code works with the data. hope that makes sense, happy to talk further. but remember, i trust you to figure out a good solution :-) |
Thanks, @Aayush-Goel-04 |
throughout the codebase, replace string type variables with pathlib.Path type variables that represent file system paths. these objects have convenient methods/properties for common operations, as well as make clear how the data should be used (as a file system path, not a string to display to the user, or whatever).
The text was updated successfully, but these errors were encountered: