hardbyte / hardbyte/python-can
How to access typing for different CAN bus interface types so Pylance can know which instance attributes exist?
オープン
- 主要言語
- Python
- スター
- 1.6k
- フォーク
- 697
- PR マージ指標
- 30日以内にマージされた PR はありません
説明
Currently instantiating a bus looks something like:
```python
bus: can.bus.BusABC = can.Bus(channel="can0", can_filters=[...], interface="socketcan", bitrate=250_000)
```
However, then `bus.channel` is unknown because it is not defined in `can.bus.BusABC`, but `channel` is a defined and used attributed in subclasses such as `KvaserBus` and `SocketcanBus`. Is there a more specific type that can be used, or something that exposes the `channel` argument provided when instantiating a CAN bus?
コントリビューションガイド
評価
この issue はまだ評価されていません。