Skip to content

datetime.time is not implemented #331

@nurikk

Description

@nurikk

from datetime import time raises ImportError: cannot import name 'time' from 'datetime' (unknown location).

Repro

cargo run -- -c "from datetime import time; print(time(12,00))"

Cause

  • crates/monty/src/modules/datetime.rs only exposes date, datetime, timedelta, timezone (labelled "minimal phase-1 surface").
  • Type enum in crates/monty/src/types/type.rs has no Time variant, so no runtime type backs the class.

Scope

Adding time needs: Type::Time, a types/time.rs with constructor validation + PyTrait, StaticStrings::Time, and a set_attr wiring in the module. tzinfo support on time is an open design question (Monty has no tzinfo ABC today).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions