def pull_handshake_type(buf: Buffer, expected_type: HandshakeType) -> None:
    """
    Pull the message type and assert it is the expected one.

    If it is not, we have a programming error.
    """
    message_type = buf.pull_uint8()
    assert message_type == expected_type

    Pull the message type and assert it is the expected one.

    If it is not, we have a programming error.
    
src/aioquic/tls.py