MCPcopy Create free account
hub / github.com/Textualize/textual / get_byte

Function get_byte

src/textual/_binary_encode.py:186–200  ·  view source on GitHub ↗

Get an encoded byte and advance position. Raises: DecodeError: If the end of the data was reached Returns: A bytes object with a single byte.

()

Source from the content-addressed store, hash-verified

184 position = 0
185
186 def get_byte() -> bytes:
187 """Get an encoded byte and advance position.
188
189 Raises:
190 DecodeError: If the end of the data was reached
191
192 Returns:
193 A bytes object with a single byte.
194 """
195 nonlocal position
196 if position >= max_position:
197 raise DecodeError("More data expected")
198 character = encoded[position : position + 1]
199 position += 1
200 return character
201
202 def peek_byte() -> bytes:
203 """Get the byte at the current position, but don't advance position.

Callers 7

decode_intFunction · 0.85
decode_bytesFunction · 0.85
decode_stringFunction · 0.85
decode_listFunction · 0.85
decode_tupleFunction · 0.85
decode_dictFunction · 0.85
decodeFunction · 0.85

Calls 1

DecodeErrorClass · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…