Skip to content

[MNT]: Cleanup Timer inheritance scheme #26855

@anntzer

Description

@anntzer

Summary

Currently, subclasses inheriting from TimerBase need to override a number of private methods (at least _timer_start() and _timer_stop(), as well as optionally a few others). It would be better (e.g. for documentation purposes, as argued elsewhere) if only public methods needed to be overridden.

At a first glance this should be fairly doable, by directly overriding start() and stop() instead (possibly getting rid of the interval kwarg to start(), which we never use and can be replaced by timer = Timer(interval=...) or timer.interval = ... before starting anyways) and reading the values off timer.interval and timer.single_shot directly. Of course, the change would need to go through deprecate_method_override, yada yada.

Proposed fix

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions