I send a object over a socket and want to know the size of the object as bytes. I write a method return the object as bytes. At the receiver side a have to know the size of the object so I import the class and want to use a constant. To define the constant I wrote a classmethod who return the length in bytes but i can´t call the classfunction in the class themself. The size of the object can by change while developing the project and thats why i dynamicly what to calc the uses size.

```py
class democlass():

    BYTE_SIZE = democlass.get_byte_size()

    def __init__(self, t: int):
        self.data = t

    def as_bytes(self) -> bytes:
        """
        Some struct.pack() stuff.
        """
        return objectasbytes

    @classmethod
    def get_byte_size(cls) -> int:
        return len(democlass(5).as_bytes())

```

```py
import democlass

class server(threading.Thread):

    def __init__(self, t: int):
        threading.Thread.__init__(self)
        self.__sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
        addr = (
            '0.0.0.0',
            self.port
        )
        self.__sock.bind(addr)

    def run(self) -> bytes:
        while True:
            msg = sock.recv(democlass.BYTE_SIZE)
            do_something_withdata()

```

Errormessage:

```
BYTE_SIZE = democlass.get_byte_size()
NameError: name 'democlass' is not defined

```