Component evidence

websockets/typing.py

websockets · src/websockets/typing.py · python · BSD-3-Clause
integrationIntegration / API

Defines type aliases for WebSocket messages, headers, and logging.

Source preview first 800 characters · full source over MCP
# Source: https://github.com/python-websockets/websockets | License: BSD-3-Clause | Copyright Aymeric Augustin and contributors
# Provided via justclaw.it.com; keep this notice with the code.
from __future__ import annotations

import http
import logging
import os
from typing import Any, NewType, Sequence


__all__ = [
    "Data",
    "LoggerLike",
    "StatusLike",
    "Origin",
    "Subprotocol",
    "ExtensionName",
    "ExtensionParameter",
]


# Public types used in the signature of public APIs

Data = str | bytes
"""Types supported in a WebSocket message:
:class:`str` for a Text_ frame, :class:`bytes` for a Binary_ frame.

.. _Text: https://datatracker.ietf.org/doc/html/rfc6455#section-5.6
.. _Binary : https://datatracker.ietf.org/doc/html/rfc6455#section-5.6

"""

BytesLike = bytes 

... (truncated -- full source via MCP)