[Python-ideas] Dunder method to make object str-like
Ethan Furman
ethan at stoneleaf.us
Mon Apr 11 11:13:32 EDT 2016
On 04/11/2016 07:43 AM, Nikolaus Rath wrote:
> On Apr 10 2016, Ethan Furman wrote:
>> By having a well-defined protocol and helper function we not only make
>> our own lives easier but we also make the lives of third-party
>> libraries and experimenters easier.
>
> To me this sounds like catering to a hypothetical audience that may want
> to do hypothetical things. If you start with the above, and people
> complain that their favorite non-pathlib path library is not supported
> by the stdlib, you can still add a protocol. But if you add a protocol
> right away, you're stuck with the complexity for a very long time even
> if almost no one actually uses it.
The part of "make our own lives easier" is not a hypothetical audience.
Making my own library (antipathy) work seamlessly with pathlib and
DirEntry is not hypothetical.
--
~Ethan~
More information about the Python-ideas
mailing list