From c0aa7292dc6b132892e1b4385b9b7db91be16bdb Mon Sep 17 00:00:00 2001 From: Adeeb Shihadeh Date: Wed, 28 Aug 2024 19:28:52 -0700 Subject: [PATCH] new optional syntax --- opendbc/car/interfaces.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/opendbc/car/interfaces.py b/opendbc/car/interfaces.py index 3d5252dcb8..64b648f1cf 100644 --- a/opendbc/car/interfaces.py +++ b/opendbc/car/interfaces.py @@ -5,7 +5,7 @@ import tomllib from abc import abstractmethod, ABC from enum import StrEnum -from typing import Any, NamedTuple, Optional +from typing import Any, NamedTuple from collections.abc import Callable from functools import cache @@ -102,7 +102,7 @@ def __init__(self, CP: structs.CarParams, CarController, CarState): dbc_name = "" if self.cp is None else self.cp.dbc_name self.CC: CarControllerBase = CarController(dbc_name, CP) - def apply(self, c: structs.CarControl, now_nanos: Optional[int] = None) -> tuple[structs.CarControl.Actuators, list[CanData]]: + def apply(self, c: structs.CarControl, now_nanos: int | None = None) -> tuple[structs.CarControl.Actuators, list[CanData]]: if now_nanos is None: now_nanos = int(time.monotonic() * 1e9) return self.CC.update(c, self.CS, now_nanos)