From 6a41954346ef28253d1b98f8c4b0237b3237b82c Mon Sep 17 00:00:00 2001 From: Jade Turner Date: Fri, 13 Sep 2024 11:58:32 +0800 Subject: [PATCH 1/2] Add a warning to schedule docs See https://github.com/wpilibsuite/allwpilib/pull/7073/ --- commands2/commandscheduler.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/commands2/commandscheduler.py b/commands2/commandscheduler.py index 7777b8c..6e3d3d7 100644 --- a/commands2/commandscheduler.py +++ b/commands2/commandscheduler.py @@ -177,6 +177,8 @@ def schedule(self, *commands: Command) -> None: using those requirements have been scheduled as interruptible. If this is the case, they will be interrupted and the command will be scheduled. + WARNING: using this function directly is often a footgun and should be avoided. Instead Triggers should be used to schedule Commands. + :param commands: the commands to schedule. """ for command in commands: From b97310fab904b9c992e98a76ed11b4ecbfae3dd5 Mon Sep 17 00:00:00 2001 From: Jade Date: Wed, 29 Jan 2025 22:50:48 +0800 Subject: [PATCH 2/2] Update commandscheduler.py --- commands2/commandscheduler.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/commands2/commandscheduler.py b/commands2/commandscheduler.py index 6e3d3d7..7eba7a4 100644 --- a/commands2/commandscheduler.py +++ b/commands2/commandscheduler.py @@ -177,7 +177,8 @@ def schedule(self, *commands: Command) -> None: using those requirements have been scheduled as interruptible. If this is the case, they will be interrupted and the command will be scheduled. - WARNING: using this function directly is often a footgun and should be avoided. Instead Triggers should be used to schedule Commands. + WARNING: using this function directly can often lead to unexpected behavior and should be + avoided. Instead Triggers should be used to schedule Commands. :param commands: the commands to schedule. """