Improve can.Bus typing by zariiii9003 · Pull Request #1557 · hardbyte/python-can

Conversation

@zariiii9003

Convert can.Bus into a function to clean up a lot of the messy typing. This should fix the pyright abstract class complaints.

I had to move the can.BusABC documentation from internal-api.rst to bus.rst, the private methods of can.BusABC are still documented in internal-api.rst.

@zariiii9003 zariiii9003 added the QA

about improving and maintaining the quality of the library

label

Apr 4, 2023

lumagi

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I took the liberty of reviewing the PR. I think this is a really nice change. I know that having both Bus and BusABC was something that confused me when I first started using python-can.

@zariiii9003

Thank you for taking a look. I will wait with merging until 4.2 is released.
I had the same experience with Bus and BusABC. 😄

I'd like to hear more opinions on this though.

hardbyte

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job. I remember really struggling with the Bus/BusABC design many many years ago!

Labels

QA

about improving and maintaining the quality of the library