Python typing, if none is given return none

前端 未结 0 1454
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-01-27 05:09

Is it possible to write a typehint in python that guarantees if None is given to a function then None is returned?

For example this is possible:

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