Skip to content

Nothing

Bases: ColumnType

Type for a column that contains None Values only.

Source code in src/safeds/data/tabular/typing/_column_type.py
@dataclass
class Nothing(ColumnType):
    """Type for a column that contains None Values only."""

    _is_nullable: bool

    def __init__(self) -> None:
        self._is_nullable = True

    def __repr__(self) -> str:
        result = "Nothing"
        if self._is_nullable:
            result += "?"
        return result

    def is_nullable(self) -> bool:
        """
        Return whether the given column type is nullable.

        Returns
        -------
        is_nullable : bool
            True if the column is nullable.
        """
        return True

    def is_numeric(self) -> bool:
        """
        Return whether the given column type is numeric.

        Returns
        -------
        is_numeric : bool
            True if the column is numeric.
        """
        return False

__init__()

Source code in src/safeds/data/tabular/typing/_column_type.py
def __init__(self) -> None:
    self._is_nullable = True

__repr__()

Source code in src/safeds/data/tabular/typing/_column_type.py
def __repr__(self) -> str:
    result = "Nothing"
    if self._is_nullable:
        result += "?"
    return result

is_nullable()

Return whether the given column type is nullable.

Returns:

Name Type Description
is_nullable bool

True if the column is nullable.

Source code in src/safeds/data/tabular/typing/_column_type.py
def is_nullable(self) -> bool:
    """
    Return whether the given column type is nullable.

    Returns
    -------
    is_nullable : bool
        True if the column is nullable.
    """
    return True

is_numeric()

Return whether the given column type is numeric.

Returns:

Name Type Description
is_numeric bool

True if the column is numeric.

Source code in src/safeds/data/tabular/typing/_column_type.py
def is_numeric(self) -> bool:
    """
    Return whether the given column type is numeric.

    Returns
    -------
    is_numeric : bool
        True if the column is numeric.
    """
    return False