[Python-Dev] Defining a path protocol (original) (raw)

Chris Angelico rosuav at gmail.com
Thu Apr 7 08:11:34 EDT 2016


On Thu, Apr 7, 2016 at 9:44 AM, Ethan Furman <ethan at stoneleaf.us> wrote:

Excellent! Narrowing the field then to:

fspath ospath

Step right up! Cast yer votes!

+0.9 for fspath; I'd prefer a one-word name, but with path out of the running (which I agree with), there's no other obvious word. fspath is a close second.

-1 for os_path, unless it's reasonable to justify it as "most of the standard library uses Path objects, but os.path uses strings, so before you pass a Path to anything in os.path, you call path.ospath() on it, which calls os_path()". And that seems a bit hairy and roundabout; what it's really doing is giving you back a string, and that has little to do with os.path.

ChrisA



More information about the Python-Dev mailing list