Skip to content

Latest commit

 

History

History

ep007

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

Today we talk about a common stumbling block in python typing -- the NoReturn annotation!

Interactive examples

Python

import dis
dis.dis(has_no_return_statements)

stack = []
stack.append(print)
stack.append('hello world')
args = [stack.pop() for _ in range(1)]
func = stack.pop()
stack.append(func(*args))
stack
stack.pop()
stack

stack.append(None)
repr(stack.pop())

Bash

python -i t.py