Stopping Runtime Type Errors with mypy Static Analysis
Stop runtime TypeErrors before they hit production. Learn how to use mypy for static type checking in Python, including gradual typing and CI/CD integration.
ReadMeFeed / Community knowledge
Real questions. Useful conversations. Find the people who know your stack.
Stop runtime TypeErrors before they hit production. Learn how to use mypy for static type checking in Python, including gradual typing and CI/CD integration.
Now that Python 3.10 has been released, is there any preference when indicating that a parameter or returned value might be optional, i.e., can be None . So what is preferred: Option 1: def f(parameter: Optional[int]) -> Optional[str]: Option 2: def f(parameter: int | None) -> str | None: Also, is there any preference between Type | None and None | Typ