Strict typing using pyright is compulsory. Add pyright section in pyproject.toml
[tool.pyright]
typeCheckingMode = "strict"
Preferred formatter for python is black
.
[tool.black]
line-length = 79
preview = true
Preferred import sort tool for python is isort
. We use single line for imports because it reduces the line length and makes the code pretty.
[tool.isort]
line_length = 79
force_single_line = true
"""
A description of the function
@param1: value
@param2: value
@param3: value
@param4: value
"""
Example:
class User:
def __init__(self, username:str, password:str):
"""
A class for a user
@username: The name of the user
@password: A strong password for the user
"""
self.username = username
self.password = password