What would be the correct way to format the name of a type alias—intended to be local to its module—according to the PEP8 style guide?
# mymodule.py
from typing import TypeAlias
mytype: TypeAlias = int
def f() -> mytype:
return mytype()
def g() -> mytype:
return mytype()
Should mytype be formatted in CapWords because it introduces a new type similar to creating new classes? Or, should mytype be formatted in all caps because it is treated similarly to a constant?
Is there a way to differentiate between type aliases that will remain unchanged (constant) throughout the lifetime of the program and ones that can change (similar to the Final annotation for constants)?
Also, should mytype be prefixed with an underscore (as in _mytype) to indicate that the type alias shouldn't be used outside this module?