@wilfredh I personally don't like having filesystem operations as methods on Path. It doesn't always make sense (e.g. paths in a tar file) and even when it does I like the separation between "pure" path operations and those that need to touch an actual fs.
Chris Denton@chrisdenton@hachyderm.io
@wilfredh path.read_string sounds very rubyish. if your language has extension methods or type classes, it seems like providing this in a separate module would be the right way to let someone have a choice on it (definitely it makes sense to let the user choose whether a host fs interface is part of the platform dependencies of path).
prozacchiwawa@prozacchiwawa@functional.cafe
@wilfredh What's wrong with UFCS?
Peter Ludemann@PeterLudemann@mathstodon.xyz
@PeterLudemann It complicates namespaces: the availability of .foo() now depends on what you've imported, especially if you want x.foo() and y.foo() to be different.
It also leads to multiple ways of expressing the same thing, making codebases less consistent.
This is all subjective, of course, but I'm currently favouring not implementing UFCS.
Wilfred Hughes
@wilfredh Static or dynamic types? Function overloading?
Also, this has had extensive discussion, both in the PEP and the mailing list, which might give you a sense of the pros and cons.
Peter Ludemann@PeterLudemann@mathstodon.xyz
@wilfredh I don't understand how the availability of .foo() depends on what you've imported ... the whole point of x.foo() and y.foo() is to isolate the "foo" to the types that x and y have. That is, "foo" isn't visible outside of using or specifying x or y.
@PeterLudemann Sure, but under UFCS, x.foo() and foo(x) are equivalent, so importing a standalone function foo makes x.foo() available.
Wilfred Hughes
@wilfredh Disambiguation the Python way: Class.method?
It turns out that for large programs, fully qualified names help a lot with readability, even with IDEs that can do lookup. (Or partially qualified names)
"from mymodule import *" is forbidden in the Google style guide, instead do "import my module" and then "mymodule.foo()"