---- ORIGINAL MESSAGE ---- Date: 2022-04-19 22:10:47 UTC+0200 From: eric@traut.com To: typing-sig@python.org Subject: [Typing-sig] Re: Simple syntax for Literal
As @Mehdi2277 mentioned, using a bare `Final` annotation addresses this use case already. It works fine if the expression on the RHS of the assignment is simple, such as a literal integer value (`1`) or the negation of an integer literal (`-1`). I wouldn't recommend using more complex expressions on the RHS of a `Final` declaration, at least if this is part of a library, because inference results for more complex expressions can differ from one type checker to another. _______________________________________________ Typing-sig mailing list -- typing-sig@python.org To unsubscribe send an email to typing-sig-leave@python.org https://mail.python.org/mailman3/lists/typing-sig.python.org/ Member address: dev@reggx.eu