is_bytes_sequence_annotation() — fastapi Function Reference
Architecture documentation for the is_bytes_sequence_annotation() function in shared.py from the fastapi codebase.
Entity Profile
Dependency Diagram
graph TD 7902a3e7_b475_cc3f_95dd_6266d428706b["is_bytes_sequence_annotation()"] 3e898b29_4dd8_c417_2d9b_a84d867423b4["shared.py"] 7902a3e7_b475_cc3f_95dd_6266d428706b -->|defined in| 3e898b29_4dd8_c417_2d9b_a84d867423b4 c61b742d_3494_8846_39b6_68d741addc44["test_is_bytes_sequence_annotation_union()"] c61b742d_3494_8846_39b6_68d741addc44 -->|calls| 7902a3e7_b475_cc3f_95dd_6266d428706b 8270df11_9596_bb04_cf3e_ab064ec2d09a["field_annotation_is_sequence()"] 7902a3e7_b475_cc3f_95dd_6266d428706b -->|calls| 8270df11_9596_bb04_cf3e_ab064ec2d09a f02e93f6_c9f3_2f06_52c9_e35e989f355c["is_bytes_or_nonable_bytes_annotation()"] 7902a3e7_b475_cc3f_95dd_6266d428706b -->|calls| f02e93f6_c9f3_2f06_52c9_e35e989f355c style 7902a3e7_b475_cc3f_95dd_6266d428706b fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
fastapi/_compat/shared.py lines 150–162
def is_bytes_sequence_annotation(annotation: Any) -> bool:
origin = get_origin(annotation)
if origin is Union or origin is UnionType:
at_least_one = False
for arg in get_args(annotation):
if is_bytes_sequence_annotation(arg):
at_least_one = True
continue
return at_least_one
return field_annotation_is_sequence(annotation) and all(
is_bytes_or_nonable_bytes_annotation(sub_annotation)
for sub_annotation in get_args(annotation)
)
Domain
Subdomains
Defined In
Source
Frequently Asked Questions
What does is_bytes_sequence_annotation() do?
is_bytes_sequence_annotation() is a function in the fastapi codebase, defined in fastapi/_compat/shared.py.
Where is is_bytes_sequence_annotation() defined?
is_bytes_sequence_annotation() is defined in fastapi/_compat/shared.py at line 150.
What does is_bytes_sequence_annotation() call?
is_bytes_sequence_annotation() calls 2 function(s): field_annotation_is_sequence, is_bytes_or_nonable_bytes_annotation.
What calls is_bytes_sequence_annotation()?
is_bytes_sequence_annotation() is called by 1 function(s): test_is_bytes_sequence_annotation_union.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free