Author lucas.steinmann
Recipients Jeffrey.Kintscher, Nophke, brett.cannon, lucas.steinmann, pitrou, terry.reedy
Date 2019-07-08.13:47:26
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1562593646.67.0.38254215418.issue37130@roundup.psfhosted.org>
In-reply-to
Content
@Brett: I also think making Path('.').name evaluate to '.' would be the most logical thing. More even so since the documentation says PurePath.name() is equivalent to os.path.basename()[1], but:

>>> Path('.').name
''
>>> os.path.basename('.')
'.'

Though I'm not sure if that is ok to change this behaviour or if people already rely on it.

No matter which decision is made, I would say the documentation should be improved.
If it will be the same as basename, document this also here [2].
Otherwise add a note to [1], maybe in the same format and position as was done for os.path.relpath().

[1] https://docs.python.org/3/library/pathlib.html#correspondence-to-tools-in-the-os-module
[2] https://docs.python.org/3/library/pathlib.html#pathlib.PurePath.name
History
Date User Action Args
2019-07-08 13:47:26lucas.steinmannsetrecipients: + lucas.steinmann, brett.cannon, terry.reedy, pitrou, Jeffrey.Kintscher, Nophke
2019-07-08 13:47:26lucas.steinmannsetmessageid: <1562593646.67.0.38254215418.issue37130@roundup.psfhosted.org>
2019-07-08 13:47:26lucas.steinmannlinkissue37130 messages
2019-07-08 13:47:26lucas.steinmanncreate