Skip to content

Support for function update_deadline in Python target#558

Open
byeonggiljun wants to merge 6 commits intomainfrom
python-update-deadline
Open

Support for function update_deadline in Python target#558
byeonggiljun wants to merge 6 commits intomainfrom
python-update-deadline

Conversation

@byeonggiljun
Copy link
Collaborator

@byeonggiljun byeonggiljun commented Feb 5, 2026

This PR adds the function update_deadline in the Python target.

Companion lingua-franca PR: lingua-franca/pull/2590
Companion lf-python-support: lf-lang/lf-python-support#30

The newly introduced function py_update_deadline parses the deadline value from Python as a double and converts it to uint64_t to support fractional time values (e.g., SEC(0.5)).
Other Python APIs that take time values (e.g., schedule()) raise a type error when given floating-point arguments; extending fractional-time support to those APIs will be done in other PRs.

@byeonggiljun byeonggiljun force-pushed the python-update-deadline branch from bbbeb4e to 3e9e32a Compare February 5, 2026 22:22
@byeonggiljun byeonggiljun requested review from Jakio815, edwardalee and hokeun and removed request for edwardalee February 5, 2026 22:49
Copy link
Member

@hokeun hokeun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

Copy link
Contributor

@edwardalee edwardalee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Some small editing suggestions...

Comment on lines +111 to +112
* Therefore, you need to invoke check_deadline after
* update the deadline through this function to confirm
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* Therefore, you need to invoke check_deadline after
* update the deadline through this function to confirm
* Therefore, you may want to invoke check_deadline after
* updating the deadline through this function to confirm

* @param self The Python object of the reactor.
* @param args contains:
* - updated_deadline: The updated deadline.
* @return Py_None
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* @return Py_None
* @return Py_None or NULL if an error occurs.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be changed to master after the companion merge occurs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants