should basename() follow Unix or Python?
In that in Python basename("/foo/bar/") is "", and in Unix it is bar.
R follows the Unix convention, btw.:
❯ basename("/foo/bar/")
[1] "bar"
Essentially, Python always returns a file name (or an empty string). Which makes sense to me, but then I would not call it basename, just because that's a standard Unix name for something slightly different.
I think following R + unix is probably the best route. It might be worth an as_python argument to allow that behaviour, so long as it's not the default...
Yes, agreed.
As for the Python-like behaviour, how about having a separate function that behaves like that, i.e. always gives a file name (or nothing)?