This commit is contained in:
Ingy döt Net 2013-04-10 21:29:02 -07:00
parent 764da6cbbb
commit db842d013d
19005 changed files with 197040 additions and 7 deletions

View file

@ -0,0 +1,22 @@
# Checking for system version
import sys
major, minor, bugfix = sys.version_info[:3]
if major < 2:
sys.exit('Python 2 is required')
def defined(name): # LBYL (Look Before You Leap)
return name in globals() or name in locals() or name in vars(__builtins__)
def defined2(name): # EAFP (Easier to Ask Forgiveness than Permission)
try:
eval(name)
return True
except NameError:
return False
if defined('bloop') and defined('abs') and callable(abs):
print abs(bloop)
if defined2('bloop') and defined2('abs') and callable(abs):
print abs(bloop)