-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Open
Labels
Description
Feature
Constants are usually defined on a module level and written in all capital letters with underscores separating words. Examples include
MAX_OVERFLOW
andTOTAL
. (ref. PEP 8)
It's de-facto standard in the industry, therefore we could infer Final
from variables written in all capital letters.
Pitch
I think that this behaviour would match natural programmers expectations. Currently the need of using all-caps and a Final
type annotation seems not being minimal.
MAX_SIZE = 9000
MAX_SIZE += 1 # Error reported by type checker
class Connection:
TIMEOUT = 10
class FastConnector(Connection):
TIMEOUT = 1 # Error reported by type checker
pierrepo and jorenhamsterliakov