Mpypy: Generic container with some methods only valid if extra protocols apply

前端 未结 0 411
别那么骄傲
别那么骄傲 2020-12-01 03:57

In mypy, how would you specify that a type Generic over T has methods that are only valid if T meets certain conditions?

For ex

相关标签:
回答
  • 消灭零回复
提交回复
热议问题