MCPcopy Create free account
hub / github.com/python-websockets/websockets / peek_ahead

Function peek_ahead

src/websockets/headers.py:73–82  ·  view source on GitHub ↗

Return the next character from ``header`` at the given position. Return :obj:`None` at the end of ``header``. We never need to peek more than one character ahead.

(header: str, pos: int)

Source from the content-addressed store, hash-verified

71
72
73def peek_ahead(header: str, pos: int) -> str | None:
74 """
75 Return the next character from ``header`` at the given position.
76
77 Return :obj:`None` at the end of ``header``.
78
79 We never need to peek more than one character ahead.
80
81 """
82 return None if pos == len(header) else header[pos]
83
84
85_OWS_re = re.compile(r"[\t ]*")

Callers 4

parse_listFunction · 0.85
parse_extension_itemFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…