Avatar ·

Cómo hacer una propiedad estática de clase en Python?

📁 python, Error: Análisis de errores (SyntaxError, TypeError, etc.)

Lo intento así:

class ChatCodes:   _chat = 'cht'   @property   def chat(self):      retu self._chat

si lo uso así:

print(ChatCodes.chat + 'any_str')

aparece un error:

unsupported operand type(s) for +: 'property' and 'str'

¿cómo crear correctamente una propiedad estática?