
Daily Bite of Python: Don't call open() with invalid mode strings - cneumann81
https://www.quantifiedcode.com/app/issue_class/985a8e02d1df48808e6c6ef2aef2af2f
======
gjvc
how is this at all insightful?

~~~
cneumann81
Why would it not be insightful?

~~~
gjvc
oh dear.

your comment is disingenuous.

I cannot answer why it would not be. Perhaps the link author or poster wants
to generate traffic -- please ask him or her about that.

I can however answer why it is not insightful / of no value. It's not saying
anything of any interest about "how to open a file in python" beyond "don't go
against the instructions".

~~~
cneumann81
You can ask me directly. We are compiling this and other insights, because we
found these issues hundreds of times in the Python code we analyse. Clearly,
not everyone is aware of the problem that goes along with wrong mode strings,
but even if you do, you might still make a mistake when changing them during
refactorings. So I think it is good to be aware. Especially for Python
beginners it is a good thing to know. Sorry, if this bothered you. We maintain
also a repo on GitHub where you can share any of your your insights:
[https://github.com/quantifiedcode/python-anti-
patterns](https://github.com/quantifiedcode/python-anti-patterns)

