Skip to content

Commit

Permalink
Make mypy happy about SysIdRoutine.Mechanism.name
Browse files Browse the repository at this point in the history
  • Loading branch information
auscompgeek committed Jan 26, 2024
1 parent 96a5baa commit e5b4e24
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions commands2/sysid/sysidroutine.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# validated: 2024-01-26 DV 19c155647273 sysid/SysIdRoutine.java
from dataclasses import dataclass
from dataclasses import dataclass, field
from enum import Enum

from wpilib.sysid import SysIdRoutineLog, State
Expand Down Expand Up @@ -78,10 +78,10 @@ class Mechanism:
drive: Callable[[volts], None]
log: Callable[[SysIdRoutineLog], None]
subsystem: Subsystem
name: Optional[str] = None
name: str = None # type: ignore[assignment]

def __post_init__(self):
if self.name == None:
if self.name is None:
self.name = self.subsystem.getName()

class Direction(Enum):
Expand Down

0 comments on commit e5b4e24

Please sign in to comment.