[issue33186] Memory corruption with urllib.parse

Ivan Zakharyaschev report at bugs.python.org
Sat Mar 31 06:57:10 EDT 2018


Ivan Zakharyaschev <imz at altlinux.org> added the comment:

Actually, Alexey shared this problem with me orally first, and then asked to have a look at his report, and I felt that just describing the technical details about what is going on is not enough, and suggested to include a brief sentence which would state what kind of assumptions seemed to be broken to Alexey. And it was:

> a list contains elements that have never been appended.

And this statement actually appeared quite helpful for me: in a few hours after this statement was made, I got an idea that this statement might actually be not true in this case. And this quickly lead me to the demonstration what really happens here, and that it was correct Python behavior.

Without this brief formal statement of the broken assumptions, I had simply had no ideas (because I supposed that something was going wrong according to Alexey's words, and didn't question whether it is really wrong or we might expect these results under some conditions as correct results).

(Actually, I'm a fan of type-checking, and what is more, of languages with expressive types like Agda or Idris where the programmer is to make provable statements of the expected properties written down as types; sometimes, they can be derived automatically, but nevertheless my point is the attitude to programming, even without formal tools: think how the expected properties would be proved, how they would be decomposed into simpler statements during the proof. Well, this is offtopic here, so, Alexey, let's not continue this discussion here.)

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue33186>
_______________________________________


More information about the Python-bugs-list mailing list