[Python-ideas] Better stdlib support for Path objects

Barry Warsaw barry at python.org
Tue Oct 7 15:37:10 CEST 2014


On Oct 07, 2014, at 11:34 AM, Antoine Pitrou wrote:

>IMO it's reasonable, but assuming we devise a dedicated protocol for
>getting a path's representation (e.g. __strpath__). Concrete type
>checking should be avoided.

What would __strpath__ do that __str__ wouldn't do?  Or do you think it's
better to explicitly disallow str-like objects that aren't path objects?

What I'm trying to understand is whether str(argument) is that "path protocol"
or whether there's a good reason that something else that's specifically not
str-ification is required.

Cheers,
-Barry
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20141007/a32a3083/attachment.sig>


More information about the Python-ideas mailing list