This is already available with typing.Final and immutable types:

from typing import Final

ham: Final = 3
ham = 4 # Error

hams: Final[Sequence[str]] = ["ham", "spam"]
hams.append("meat") # Error

On Mon, 24 May 2021, 18:40 Abdur-Rahmaan Janhangeer, <> wrote:

Just a light-hearted note, if ever the idea is taken seriously, 

variable: constant = 10 

seems more pythonic to me. 

constant variable = 10 opens the doors for

int x = 5 etc

Kind Regards,

Abdur-Rahmaan Janhangeer
Python-ideas mailing list --
To unsubscribe send an email to
Message archived at
Code of Conduct: