Return the expected Python response shape for ``r``. One of: * ``"legacy_resp2"`` — native RESP2 wire, or RESP3 wire normalised by the legacy adapters back to RESP2 Python shapes. * ``"legacy_resp3"`` — Python shapes from the previous RESP3 callbacks, produced when the call
(r)
| 853 | |
| 854 | |
| 855 | def expected_response_shape(r): |
| 856 | """Return the expected Python response shape for ``r``. |
| 857 | |
| 858 | One of: |
| 859 | |
| 860 | * ``"legacy_resp2"`` — native RESP2 wire, or RESP3 wire normalised by |
| 861 | the legacy adapters back to RESP2 Python shapes. |
| 862 | * ``"legacy_resp3"`` — Python shapes from the previous RESP3 callbacks, |
| 863 | produced when the caller pinned ``protocol=3`` with |
| 864 | ``legacy_responses=True``. |
| 865 | * ``"unified"`` — protocol-agnostic unified Python shapes selected by |
| 866 | ``legacy_responses=False``. |
| 867 | """ |
| 868 | if not get_legacy_responses(r): |
| 869 | return "unified" |
| 870 | raw_protocol = _get_raw_protocol(r) |
| 871 | if raw_protocol is None or raw_protocol in ("2", 2): |
| 872 | return "legacy_resp2" |
| 873 | return "legacy_resp3" |
| 874 | |
| 875 | |
| 876 | def expects_resp2_shape(r): |
no test coverage detected