Created
April 3, 2012 20:38
-
-
Save ivangonekrazy/2295325 to your computer and use it in GitHub Desktop.
<method> ALL THE <type>!!!!!
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 inspect import ismethoddescriptor, getmembers | |
def all_the_methods(_type): | |
""" | |
example usage: | |
all_the_methods(str) | |
sample elided output: | |
capitalize() ALL THE <type 'str'>!!!! | |
center() ALL THE <type 'str'>!!!! | |
count() ALL THE <type 'str'>!!!! | |
isalnum() ALL THE <type 'str'>!!!! | |
""" | |
for m in [n for n,o in getmembers(_type) | |
if ismethoddescriptor(o) and not n.startswith('_')]: | |
print "%s() ALL THE %s!!!!" % (m, _type) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment