MCPcopy Index your code
hub / github.com/fastapi/fastapi / is_bytes_or_nonable_bytes_annotation

Function is_bytes_or_nonable_bytes_annotation

fastapi/_compat/shared.py:126–134  ·  view source on GitHub ↗
(annotation: Any)

Source from the content-addressed store, hash-verified

124
125
126def is_bytes_or_nonable_bytes_annotation(annotation: Any) -> bool:
127 if lenient_issubclass(annotation, bytes):
128 return True
129 origin = get_origin(annotation)
130 if origin is Union or origin is UnionType:
131 for arg in get_args(annotation):
132 if lenient_issubclass(arg, bytes):
133 return True
134 return False
135
136
137def is_uploadfile_or_nonable_uploadfile_annotation(annotation: Any) -> bool:

Callers 2

_extract_form_bodyFunction · 0.90

Calls 1

lenient_issubclassFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…