Enough of These Python Practices(mhaimdat.com)
mhaimdat.com
Enough of These Python Practices
https://www.mhaimdat.com/blog/tutorials/Why-Every-Python-Developer-Needs-to-Read-This/
5 comments
Some of these are bad. Pathlib is great for a one-liner to read files, and the “.get()” is broken. If it returns None, you’ll get an error about comparing None to an integer.
The type annotation `Optional[Tuple[int, int]]` is the equivalent to `None | Tuple[int, int]`. `Tuple[Optional[int], Optional[int]]` is what you wanted.
> Don't
> text_c = text_a + text_b
Stopped reading there.
> text_c = text_a + text_b
Stopped reading there.
[deleted]