On Sun, May 24, 2020 at 4:59 AM Alex Hall <alex.moj...@gmail.com> wrote:

> On Sun, May 24, 2020 at 1:42 PM Bernardo Sulzbach <
> berna...@bernardosulzbach.com> wrote:
>
>> ...  I would expect len(p) to be the "depth" of the path, which doesn't
>> make a lot of sense if it is not an absolute path.
>>
>
> I agree. I expect iteration, indexing, and length to refer to parts, not
> characters. In particular I'm a bit disappointed that `path[-1]` isn't
> equal to `path.name`, especially because finding `path.name` was tricky -
> at first I guessed path.basename (doesn't exist) and path.stem (close, but
> wrong). Can we implement that instead?
>

+1 on that!

I can't say I have better names to suggest, but I find it remarkably
difficult to figure out how to get the parts of a Path that I want

path[:-1] would really hand, too, and presumably come along with any
indexing.

-CHB

-- 
Christopher Barker, PhD

Python Language Consulting
  - Teaching
  - Scientific Software Development
  - Desktop GUI and Web Development
  - wxPython, numpy, scipy, Cython
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/HLPN53R4MKWMCTKLXWBRGJG5R56VTK22/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to