I find myself unsure whether I should set certain variables that I use in my class, like private class variables (e.g. _var) and class constant variables (e.g. VAR) and a constant class variable if such a thing (e.g. _VAR). I understand that this does not really matter in Python other than the convention, but I would like to know which path is right (or more right).
For example, let's say I have a specific variable to hold a regular expression pattern for height. Let's say I have no intention of modifying this anywhere in the class or elsewhere in the code, and in fact I use it only in one of the methods of the class I should go with:
Option 1 - set as a private class variable:
_height_pattern = r"""(#'##?"?)|#'"""
Option 2 - Defined as a constant class variable
HEIGHT_PATTERN = r"""(#'##?"?)|#'"""
Option 3 - set as a private class constant variable (not sure if such a thing exists or have I ever seen a variable declared in this for)
_height_pattern = r"""(#'##?"?)|#'"""
, , - , . , , , , . , , . , , (_SEED = 2000?), ? , , .