2021年4月2日星期五

Typing for repl/infinite-loop type

Let's say I have a function such as the following:

def echo() -> NoReturn: # correct?      while True:          val = input('echo> ')          print (val)  

What would be the correct type for this? Would this more along the lines of None or NoReturn or something else?

https://stackoverflow.com/questions/66926350/typing-for-repl-infinite-loop-type April 03, 2021 at 07:28AM

没有评论:

发表评论