I'd like to build on @batFINGER's answer.
StackExchange syntax highlighting is handled by Google Code Prettify. Looking at the source code, it appears that Code Prettify has a general set of rules that it enables/disables for languages with C-like syntax, making slight tweaks for individual languages. Python's configuration function is as follows:
}), ['cv', 'py', 'python']);
This tells us that there is no special consideration given for
snake_case, etc. in prettifying Python. So, Code Prettify is not specifically following PEP8 criterion, but rather a more general naming convention. This convention of
CamelCase for class names is found in many C style guides, which I would assume Code Prettify is based off of.