Skip to content

Instantly share code, notes, and snippets.

Avatar

Eivind fleskesvor

View GitHub Profile
View type_check.py
#!/usr/bin/python
def hello():
print "Hello, World!"
def main():
my_list = [("This is what I want to check for", hello),
("But it will also validate built-ins", isinstance),
["Let's use an array for good measure", lambda x: x]]
# my_list = ["Must be 'list' or 'tuple', so this raises an error"]
You can’t perform that action at this time.