Skip to content

NoneTime

datethyme.NoneTime

Bases: OptionalTime, BaseModel

Empty time for cases where this may be superior to using None.

Methods:

  • __init__

    Sets the attributes hour, minute, and second each to None.

  • __str__

    String conversion returns NoneTime: str(nt) == "NoneTime".

  • __repr__

    Displayed as NoneTime: repr(nt) == "NoneTime".

  • __add__

    Idempotent under addition, e.g. nt - 42 == nt

  • __sub__

    Idempotent under subtraction, e.g. nt - 42 == nt

  • __bool__

    Always has a boolean value of False.

  • __eq__

    False in all cases except when comparing with another instance of NoneTime

  • __lt__

    False in all cases.

  • __gt__

    False in all cases.

  • __le__

    False in all cases.

  • __ge__

    False in all cases.

Attributes:

model_config = ConfigDict(frozen=True) class-attribute instance-attribute

hour: None = Field(default=None, frozen=True) class-attribute instance-attribute

minute: None = Field(default=None, frozen=True) class-attribute instance-attribute

second: None = Field(default=None, frozen=True) class-attribute instance-attribute

__init__() -> None

Sets the attributes hour, minute, and second each to None.

__str__() -> str

String conversion returns NoneTime: str(nt) == "NoneTime".

__repr__() -> str

Displayed as NoneTime: repr(nt) == "NoneTime".

__add__(_: Any) -> Self

Idempotent under addition, e.g. nt - 42 == nt

__sub__(_: Any) -> Self

Idempotent under subtraction, e.g. nt - 42 == nt

__bool__() -> bool

Always has a boolean value of False.

__eq__(__other: Any) -> bool

False in all cases except when comparing with another instance of NoneTime (including self).

__lt__(__other: Any) -> bool

False in all cases.

__gt__(__other: Any) -> bool

False in all cases.

__le__(__other: Any) -> bool

False in all cases.

__ge__(__other: Any) -> bool

False in all cases.