[Python-Dev] When should pathlib stop being provisional?
Ethan Furman
ethan at stoneleaf.us
Wed Apr 6 02:20:47 EDT 2016
On 04/05/2016 10:40 PM, Stephen J. Turnbull wrote:
> Ethan Furman writes:
>
> > No, Stephen, that is not what this is about.
>
> Wrong Steven. Spelling matters in email too.
Yes, it absolutely does. My apologies.
> -1 Not good enough. I wouldn't do it that often that "ugly" overrides
> the reasoning Brett presented [...]
> But we don't object to (de)serializing dicts to (from) str (as JSON or
> pickle).
Amusingly enough, I don't have to deal with serializing dicts. :)
However, as a comparison: imagine you had to transform your dict to
JSON every time some function wanted a dict as input. And had to
transform returned JSON strings in to dicts.
> I think Path vs. string is similarly different to justify
> saying so (especially when treating user input). [...]
> Thus, strings that look like paths (as strings) actually will have
> multiple internal representations, similarly to the way that a dict
> can have multiple serializations.
I don't follow. When dealing with the file system one passes a string*
representing the path of the object one wants -- pretty much the same
string that was passed in to Path.
--
~Ethan~
* or bytes, but the same sameness, really.
More information about the Python-Dev
mailing list