spdx_tools.common.typing.constructor_type_errors

 1# SPDX-FileCopyrightText: 2023 spdx contributors
 2#
 3# SPDX-License-Identifier: Apache-2.0
 4from beartype.typing import List
 5
 6
 7class ConstructorTypeErrors(TypeError):
 8    """
 9    Helper class that holds a list of error messages. Intended to capture all TypeErrors encountered during a
10    constructor call, instead of raising only the first one.
11    """
12
13    messages: List[str]
14
15    def __init__(self, messages: List[str]):
16        self.messages = messages
17
18    def get_messages(self):
19        return list(self.messages)
class ConstructorTypeErrors(builtins.TypeError):
 8class ConstructorTypeErrors(TypeError):
 9    """
10    Helper class that holds a list of error messages. Intended to capture all TypeErrors encountered during a
11    constructor call, instead of raising only the first one.
12    """
13
14    messages: List[str]
15
16    def __init__(self, messages: List[str]):
17        self.messages = messages
18
19    def get_messages(self):
20        return list(self.messages)

Helper class that holds a list of error messages. Intended to capture all TypeErrors encountered during a constructor call, instead of raising only the first one.

ConstructorTypeErrors(messages: list[str])
16    def __init__(self, messages: List[str]):
17        self.messages = messages
messages: list[str]
def get_messages(self):
19    def get_messages(self):
20        return list(self.messages)
Inherited Members
builtins.BaseException
with_traceback
add_note
args