Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for is_bytes_sequence_annotation (0.26 sec)

  1. tests/test_compat.py

        assert response2.json() == [1, 2]
    
    
    def test_is_bytes_sequence_annotation_union():
        # For coverage
        # TODO: in theory this would allow declaring types that could be lists of bytes
        # to be read from files and other types, but I'm not even sure it's a good idea
        # to support it as a first class "feature"
        assert is_bytes_sequence_annotation(Union[List[str], List[bytes]])
    
    
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Thu Sep 28 04:14:40 GMT 2023
    - 2.8K bytes
    - Viewed (0)
  2. fastapi/_compat.py

                    return True
        return False
    
    
    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
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 22.6K bytes
    - Viewed (0)
Back to top