pymodbus-dev / pymodbus

A full modbus protocol written in python
Other
2.16k stars 891 forks source link

Use AbstractBaseClass when possible #2036

Closed alexrudd2 closed 2 months ago

alexrudd2 commented 4 months ago

There are many instances of base classes that are inherited, such ModbusBaseClient.

Usually there are methods defined in the base class that are then overridden in the subclasses. Implementations vary - sometimes it's blank, sometimes raise NotImplementedError, sometimes a dummy return value.

There may be a good opportunity to use abc.ABC (Abstract Base Classes) to define these in a more consistent way.

See https://github.com/pymodbus-dev/pymodbus/pull/2032#discussion_r1496268967

janiversen commented 4 months ago

Basically all base classes need to be corrected, the problem will be the tests.

github-actions[bot] commented 3 months ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

janiversen commented 2 months ago

this is implemented in respect of the new architecture.