[Python] constraint involving python datetime set

Discussão em 'Python' iniciado por Stack, Janeiro 11, 2025.

  1. Stack

    Stack Membro Participativo

    I get the error

    TypeError: '>' not supported between instances of 'ai.timefold.jpyinterpreter.types.datetime.PythonDate' and 'datetime.date'

    when using a constraint like

    e.timeslot.start_time.date() > datetime.date(2025,2,10)

    where e is part of the planning-entity.

    I had a similar error with str comparisons, which I could resolve by enforcing str(x) on PythonString, however, this seems to be more complicated.

    How can I get this constraint to work without resorting to desperate measures, like, e.g., creating my own "PythonDateTimeSet" class?

    Continue reading...

Compartilhe esta Página