A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2016-April/143860.html below:

[Python-Dev] Pathlib enhancments - method name only

[Python-Dev] Pathlib enhancments - method name only [Python-Dev] Pathlib enhancments - method name onlyGreg Ewing greg.ewing at canterbury.ac.nz
Sun Apr 10 02:38:35 EDT 2016
Eric Snow wrote:
> All this matters because it impacts the value returned from
> __ospath__().  Should it return the string representation of the path
> for the current OS or some standardized representation?

What standardized representation? I'm not aware of such
a thing.

> I'd expect
> the former.  However, if that is the expectation then something like
> pathlib.PureWindowsPath will give you the wrong thing if your current
> OS is linux.

No, you should get the representation corresponding to
the kind of path object you started with. If you're
working with Windows path objects on a Unix system,
they must be representing something on some Windows
system somewhere, not the one you're running the code
on. The only reason to ask for a string representation
of such a path is for use by that other system.

I don't think it even makes sense to ask for a Unix
representation of a Windows path or vice versa, because
the semantics are different. How do you translate a
Windows drive letter into Unix? What drive letter do
you use for an absolute Unix path?

-- 
Greg
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4