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-May/144577.html below:

[Python-Dev] file system path protocol PEP

[Python-Dev] file system path protocol PEP [Python-Dev] file system path protocol PEPSven R. Kunze srkunze at mail.de
Fri May 13 03:58:13 EDT 2016
On 12.05.2016 18:24, Guido van Rossum wrote:
> def fspath(p: Union[str, bytes, PathLike]) -> Union[str, bytes]:
>     if isinstance(p, (str, bytes)):
>         return p
>     try:
>         return p.__fspath__
>     except AttributeError:
>         raise TypeError(...)

@Brett
Would you think it makes sense to swap the str/bytes check and the 
__fspath__ check?


I just thought of a class subclassing str/bytes and defines __fspath__. 
Its __fspath__ method would be ignored currently.


Best,
Sven
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