There are a few constants in the code. In all cases that I’m aware of (I make no claim to be complete) those constants are defined right before they are used, and they are used two or three times. I was wondering whether those constant definitions should stay where they are.
I could think of having one place where all kind of constants are gathered. This would be a wild bunch of stuff, but only one place to look for constants. I could also think of defining them on the module level instead of (nested) function level. This way they would stay where they logically belong, but still be defined in a definite spot (at the beginning of a module). I could think of demoting them to plain variables, as they are only used within a few lines after their definition. And lastly, I can also think of ignoring this PyCharm warning complaining about variables with non-lowercase names in functions
This is a pretty minor problem, but I just came across those warnings and didn’t know how to address them separate from decorating them with a TODO.