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/143863.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 03:12:18 EDT 2016
Nick Coghlan wrote:
> Similar to my proposal for dealing with DirEntry.path being a
> bytes-like object, I'd like to suggest raising TypeError in __fspath__
> if the request is nonsensical for the currently running system - *nix
> systems can *manipulate* Windows paths (and vice-versa), but actually
> trying to *use* them with the local filesystem isn't going to work
> properly, since the syntax and semantics are different.

That sounds reasonable, since it would be preferable to
fail early if you mistakenly pass a PureWindowsPath to
e.g. open().

But there needs to be some way to ask a path object for
its native string representation, otherwise there would
be no point in using foreign path objects at all.

-- 
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