[Python-ideas] Introduce typing.SupportsFsPath

robert.hoelzl at posteo.de robert.hoelzl at posteo.de
Mon Oct 8 18:02:10 EDT 2018


Hello,

Since __fspath__ was introduced in PEP 519 it is possible to create 
object classes that are representing file system paths.
But there is no corresponding type object in the "typing" module. Thus I 
cannot specify functions, that accept any kind of object which supports 
the __fspath__ protocol.

Please note that "Path" is not a replacement for "SupportsFsPath", since 
the concept of PEP 519 is, that I could implement new objects (without 
dependency to "Path")
that are implementing the __fspath__ protocol.

robert


More information about the Python-ideas mailing list