diff options
author | Campbell Barton <ideasman42@gmail.com> | 2009-08-25 17:54:56 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2009-08-25 17:54:56 +0400 |
commit | 9521fa94569b0ab1fe5c9f451e8abf7dd2290b13 (patch) | |
tree | f96cf53c1ac46348e9437c0a00c4863ed7da81a0 /source/gameengine/PyDoc | |
parent | 855974dad931bcba8a63260d1f642da49902d569 (diff) |
remove gameOb.has_key(key) method from KX_GameObject and ListValue since python 3.x removes has_key from dictionaries.
Instead use __contains__, eg.
if key in gameOb: ...
Mathutils returns from PyMath.cpp were incorrectly using wrapped Mathutils types. Wrapped types should only be used with a callback now.
Diffstat (limited to 'source/gameengine/PyDoc')
-rw-r--r-- | source/gameengine/PyDoc/GameTypes.py | 18 |
1 files changed, 3 insertions, 15 deletions
diff --git a/source/gameengine/PyDoc/GameTypes.py b/source/gameengine/PyDoc/GameTypes.py index 9c426aed8e0..c391d0c3dec 100644 --- a/source/gameengine/PyDoc/GameTypes.py +++ b/source/gameengine/PyDoc/GameTypes.py @@ -1023,12 +1023,6 @@ class CListValue(CPropValue): Return the value matching key, or the default value if its not found. @return: The key value or a default. """ - def has_key(key): - """ - Return True if the key is found. - @rtype: boolean - @return: The key value or a default. - """ def from_id(id): """ This is a funtion especially for the game engine to return a value with a spesific id. @@ -1582,7 +1576,7 @@ class KX_GameObject(SCA_IObject): @ivar childrenRecursive: all children of this object including childrens children, (read-only). @type childrenRecursive: L{CListValue} of L{KX_GameObject}'s @group Deprecated: getPosition, setPosition, setWorldPosition, getOrientation, setOrientation, getState, setState, getParent, getVisible, getMass, getMesh, getChildren, getChildrenRecursive - @group Property Access: get, has_key, attrDict, getPropertyNames + @group Property Access: get, attrDict, getPropertyNames """ def endObject(): """ @@ -2054,12 +2048,6 @@ class KX_GameObject(SCA_IObject): Return the value matching key, or the default value if its not found. @return: The key value or a default. """ - def has_key(key): - """ - Return True if the key is found. - @rtype: boolean - @return: The key value or a default. - """ class KX_IpoActuator(SCA_IActuator): @@ -5745,7 +5733,7 @@ for name, val in locals().items(): # Store the mappings to new attributes in a list (because there # could be collisions). - if not depAttrs.has_key(attrName): + if attrName not in depAttrs: depAttrs[attrName] = {} mapping = depAttrs[attrName] @@ -5770,7 +5758,7 @@ for name, val in locals().items(): # Another mapping, from a conversion tuple to lists of class # names. conversion = (func, newAttrName) - if not mapping.has_key(conversion): + if conversion not in mapping: mapping[conversion] = [] mapping[conversion].append(name) break |