Open DanGolding opened 4 years ago
Hi @DanGolding I have done this, please let me know If I need to change anything. This is my first commit to this repo https://github.com/quantifiedcode/python-anti-patterns/pull/140
Hi @DanGolding I have done this, please let me know If I need to change anything. This is my first commit to this repo
140
Looks good, thanks :) , left a couple of comments.
Regarding the anti-pattern of not using with to open files, if you are reading the entire contents of the file in one shot as in the examples, you can use
read_text
frompathlib
which opens and closes the file for you internally. So it isn't always an anti-pattern to not use a context manager for reading text/bytes, in fact I would argue thatis an anti-pattern for