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/Expressions | |
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/Expressions')
-rw-r--r-- | source/gameengine/Expressions/ListValue.cpp | 9 | ||||
-rw-r--r-- | source/gameengine/Expressions/ListValue.h | 1 |
2 files changed, 0 insertions, 10 deletions
diff --git a/source/gameengine/Expressions/ListValue.cpp b/source/gameengine/Expressions/ListValue.cpp index 5f45cdc48a2..002674450d1 100644 --- a/source/gameengine/Expressions/ListValue.cpp +++ b/source/gameengine/Expressions/ListValue.cpp @@ -300,7 +300,6 @@ PyMethodDef CListValue::Methods[] = { /* Dict style access */ {"get", (PyCFunction)CListValue::sPyget,METH_VARARGS}, - {"has_key", (PyCFunction)CListValue::sPyhas_key,METH_O}, /* Own cvalue funcs */ {"from_id", (PyCFunction)CListValue::sPyfrom_id,METH_O}, @@ -594,14 +593,6 @@ PyObject* CListValue::Pyget(PyObject *args) return def; } -/* Matches python dict.has_key() */ -PyObject* CListValue::Pyhas_key(PyObject* value) -{ - if (PyUnicode_Check(value) && FindValue((const char *)_PyUnicode_AsString(value))) - Py_RETURN_TRUE; - - Py_RETURN_FALSE; -} PyObject* CListValue::Pyfrom_id(PyObject* value) { diff --git a/source/gameengine/Expressions/ListValue.h b/source/gameengine/Expressions/ListValue.h index 98e6f216f11..2dc458e0148 100644 --- a/source/gameengine/Expressions/ListValue.h +++ b/source/gameengine/Expressions/ListValue.h @@ -74,7 +74,6 @@ public: KX_PYMETHOD_O(CListValue,index); KX_PYMETHOD_O(CListValue,count); KX_PYMETHOD_VARARGS(CListValue,get); - KX_PYMETHOD_O(CListValue,has_key); KX_PYMETHOD_O(CListValue,from_id); |