ID EN
Typing

type_check_only

Python 3.11

Decorator to mark a class or function as unavailable at runtime.

Syntax

PYTHON
@typing.type_check_only

Examples

Example 1
PYTHON
@type_check_only
class Response:   private or not available at runtime
    code: int
    def get_header(self, name: str) -> str: ...

def fetch_response() -> Response: ...