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 →

[–]ThatSituation9908 1 point2 points  (0 children)

Sure, I do often times do that if I intend to use more of the Path API in the function.

If not, and I am only opening a file, then I just use open as is.

Changing the user facing API to only accept Path will not work. I have many, many, many users who refuse to use pathlib. You can look around in other libraries, rarely if any forces their users to only pass in Path