Browse by Topic
Popular
Popular Posts
Latest
Latest Posts
Python Overload Decorator: Multiple Type Signatures
Learn how to use Python's @overload decorator to define multiple type signatures, improving static type checking and code clarity.
Python TypedDict: Typed Dictionaries in Practice
python typeddict: How to declare typed dictionaries with Python TypedDict, how type checkers enforce keys and values, and when to choose it over dataclass or NamedTuple.
Python TypedDict: Defining Type-Safe Dictionaries
Learn how to use Python's TypedDict to declare dictionary shapes for static type checkers, improving type safety and maintainability.
Python Annotated Types: Syntax, Runtime Behavior, and Tooling
Learn how Python annotated types work: syntax examples, runtime behavior, and static type checking with mypy.
Python ClassVar: Class Variables Explained
python classvar: Understand Python class variables, how they differ from instance variables, and when to use them without introducing shared-state bugs.
Python Final Type Hint: Usage and Limitations
Learn how Python's Final type hint signals non-reassignment to static type checkers, what it does at runtime, and where it falls short.
Python Literal Type: Restricting Values with typing.Literal
Python's typing.Literal restricts a value to a fixed set. See how type checkers enforce it, how to combine it with unions and overloads, and when runtime validation is still needed.
Using Python NewType for Type Safety
Python's NewType creates distinct types for static type checking. This article explains its runtime behavior, how it differs from subclassing, and when to use it.
Python TypeAlias: Syntax, Usage, and Practical Examples
Learn how to declare and reuse Python type aliases with the type statement and typing.TypeAlias, including practical examples and when to prefer them over NewType.
Python Type Alias: Cleaner Type Hints
python type alias: Learn how to define and use type aliases in Python to simplify complex annotations, improve readability, and keep type hints maintainable.