小编jro*_*nds的帖子

Correct way to hint that a class is implementing a Protocol?

On a path of improvement for my Python dev work. I have interest in testing interfaces defined with Protocol at CI/deb building time, so that if a interface isn't actually implemented by a class we will know immediately after the unit tests run.

My approach was typing with Protocol and using implements runtime_checkable to build unit test. That works, but the team got into a little debate about how to indicate a concretion was implementing a Protocol without busting runtime_checkable. …

python unit-testing typing

10
推荐指数
1
解决办法
3862
查看次数

标签 统计

python ×1

typing ×1

unit-testing ×1