Skip to content
This repository has been archived by the owner on Jan 25, 2024. It is now read-only.

Add Backend as superclass of SerialHardwareBackend #595

Merged
merged 2 commits into from
Jul 6, 2020

Conversation

trickeydan
Copy link
Contributor

Spotted by @sersorrel in srobo/sr-robot3#2 (comment)

This also means that the abstract methods are now actually enforced.

We should consider introducing a run-time type check for this, but I am
unable to think of a good place to put it at the moment.

Checklist

  • I have updated the relevant documentation
  • I have added the semver-major, semver-minor or semver-patch label as appropriate
  • I would like multiple reviewers to approve my code before merging

Why do you want to make these changes?

Stops need to cast to Type[Backend] in environment definitions.

Which parts of the codebase do your changes affect?

SerialHardwareBackend and subclasses thereof, SRV4MotorBoardBackend, SBArduinoHardwareBackend

How do your changes affect student or volunteer experience?

Shouldn't make any difference. This is purely for typing

Are your changes related to any existing issues or PRs? How so?

We had previously attributed this bug to #489, although didn't have an open issue for it :/

Spotted by @sersorrel in srobo/sr-robot3#2 (comment)

This also means that the abstract methods are now actually enforced.

We should consider introducing a run-time type check for this, but I am
unable to think of a good place to put it at the moment.
@trickeydan trickeydan added typing A incorrect or loose type that needs correcting. semver-patch This change requires an increment in the patch version number labels Jul 5, 2020
@sersorrel
Copy link
Member

mypy's now unhappy because there's a # type: ignore which isn't needed any more, added here as part of #513, fwiw.

@codeclimate
Copy link

codeclimate bot commented Jul 5, 2020

Code Climate has analyzed commit 4e36306 and detected 0 issues on this pull request.

The test coverage on the diff in this pull request is 100.0% (95% is the threshold).

This pull request will bring the total coverage in the repository to 90.1% (0.0% change).

View more on Code Climate.

@trickeydan trickeydan added this to the 0.9.3 milestone Jul 5, 2020
@trickeydan trickeydan merged commit 34bb0c6 into srobo:master Jul 6, 2020
@trickeydan trickeydan deleted the ensure-backend-inheritance branch July 6, 2020 10:14
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
semver-patch This change requires an increment in the patch version number typing A incorrect or loose type that needs correcting.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants