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

Feature request: accept PathLike object as I/O filename #612

Closed
fepegar opened this issue Mar 21, 2018 · 1 comment
Closed

Feature request: accept PathLike object as I/O filename #612

fepegar opened this issue Mar 21, 2018 · 1 comment

Comments

@fepegar
Copy link
Contributor

fepegar commented Mar 21, 2018

I have recently started using Python 3's built-in pathlib module (introduced in PEP 428 for path managing in my projects and I really like it.

I thought that it would be nice if nibabel accepted PathLike objects as filenames, instead of only str or whatever the current behaviour is.

In my code I use wrappers for nib.load and nib.save that always transform the filename argument to str. That might be naive, but it seems to work. As a reference, matplotlib uses os.fspath if the filename argument is PathLike.

@fepegar
Copy link
Contributor Author

fepegar commented Mar 21, 2018

Closing, since I just saw that there is an open PR for this: #610

I'll reopen if it's not merged.

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

No branches or pull requests

1 participant