cloudtools / troposphere

troposphere - Python library to create AWS CloudFormation descriptions
BSD 2-Clause "Simplified" License
4.93k stars 1.45k forks source link

Mark constants as final #2126

Closed michael-k closed 1 year ago

michael-k commented 1 year ago

mypy (don't know about pyright) treats Delete = "Delete" as Delete: str = "Delete" for backwards compatibility, see https://mypy.readthedocs.io/en/stable/literal_types.html#declaring-literal-variables.

Delete: Final = "Delete" is the same as Delete: Literal["Delete"] = "Delete".

markpeek commented 1 year ago

Apologies @michael-k as merge of #2124 caused conflicts in constants.py. I'm hoping it is a quick edit to get it fixed up again.

michael-k commented 1 year ago

No worries. I need to fix some type errors anyway.

markpeek commented 1 year ago

Thanks!