If I declare an instance at the module level, which is to be set once and never changed, should I stick to uppercase naming conventions from PEP8?
E.g.
entity_manager = EntityManager(config)
vs
ENTITY_MANAGER = EntityManager(config)
There is usually no discussion when the constant is a primitive type, e.g. an integer. But what about this?
The general spirit of PEP8 is to "Keep your code consistent", whether that constant is int, string, or class instance.
According to PEP8, use upper case letters separated by underscore for constants that won't be changed through out your code. That coupled with consistency, should be applied all throughout your constants, including class instances.
On using UpperCase letters:
Constants are usually defined on a module level and written in all capital letters with underscores separating words. Examples include MAX_OVERFLOW and TOTAL.