Skip to content

Instantly share code, notes, and snippets.

@thanakijwanavit
Last active March 17, 2021 15:44
Show Gist options
  • Save thanakijwanavit/a0e707c1d51880502ea0b2764b19a633 to your computer and use it in GitHub Desktop.
Save thanakijwanavit/a0e707c1d51880502ea0b2764b19a633 to your computer and use it in GitHub Desktop.
sample type checking python and enum bear
from beartype import beartype
from typing import Optional, List
from enum import Enum
class Animal(Enum):
fish=1
cat=2
@beartype
def testBeartype(i:int, s:str, a:Optional[Animal]=None):
print(s,i, a)
testBeartype(5,'4', Animal['fish'])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment