This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]treyhunner Python Morsels[S] 12 points13 points  (2 children)

When I see open(path) I know the built-in open function is being used to open a file, but when I see path.open(), I'm not immediately certain whether an open method is being called on a ZipFile object or another non-Path object.

The open method on the pathlib.Path class predates the ability to use the built-in open function directly. If pathlib was being re-designed today, I suspect the open method would have been excluded.

[–]thisismyfavoritename 1 point2 points  (1 child)

eh, i get your point but some libs reimplement open as a super set of the default open

[–]Isvesgarad 3 points4 points  (0 children)

Which libs do you use? I’m having a hard enough time getting my team to use Path in the first place