It could be an implementation written in the buggy Python and another written in a different language.
For example you might use a ready-made WAF written in a non-Python language in front of a Python app.