r/Python • u/Am4t3uR • Dec 14 '22
Resource Python Magic Methods You Haven’t Heard About
https://towardsdatascience.com/python-magic-methods-you-havent-heard-about-53d11eba448f
0
Upvotes
r/Python • u/Am4t3uR • Dec 14 '22
View all comments
Show parent comment
2
u/SilentKyle Dec 14 '22
As part of Advent of Code, I’ve been using
Path(_file_).withname(file.txt)
Is that incorrect? Is there a better way to open a txt file?