added notNone, put clampScalar in __builtin__

This commit is contained in:
Darren Ranalli 2007-01-26 01:30:12 +00:00
parent 55a8ab333b
commit d265ae2a61
1 changed files with 8 additions and 0 deletions

View File

@ -2101,6 +2101,12 @@ def tagWithCaller(obj):
def isDefaultValue(x):
return x == type(x)()
def notNone(A, B):
# returns A if not None, B otherwise
if A is None:
return B
return A
def appendStr(obj, st):
"""adds a string onto the __str__ output of an instance"""
def appendedStr(oldStr, st, self):
@ -2655,3 +2661,5 @@ __builtin__.exceptionLogged = exceptionLogged
__builtin__.appendStr = appendStr
__builtin__.bound = bound
__builtin__.lerp = lerp
__builtin__.notNone = notNone
__builtin__.clampScalar = clampScalar