I am not looking for a "physically" immutable member field in Python as I know it is impossible, but just a type annotation to tell type checker that this field should not be re-assign a new value.
For example,
class A:
def __init__(self, x: int):
self.x: Annotated[int, Immutable] = x
def do_something(self):
self.x = 1 # type checker should be able to report error
Can I do this in Python? Or are there any better solutions?