Created
February 11, 2020 10:02
-
-
Save pschanely/6602ecb241f2c3f3ff9a190e30450623 to your computer and use it in GitHub Desktop.
Shared via CrossHair Playground
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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