Skip to content

Instantly share code, notes, and snippets.

@pschanely
Created February 11, 2020 10:02
Show Gist options
  • Save pschanely/6602ecb241f2c3f3ff9a190e30450623 to your computer and use it in GitHub Desktop.
Save pschanely/6602ecb241f2c3f3ff9a190e30450623 to your computer and use it in GitHub Desktop.
Shared via CrossHair Playground
from typing import TypedDict
class Movie(TypedDict):
name: str
year: int
def age(movie: Movie) -> int:
'''
pre: move.age < 2020
post: __return__ >= 0
'''
return 2020 - movie['year']
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment