Index: bindings/python/rhythmdb.override
===================================================================
--- bindings/python/rhythmdb.override	(revision 5086)
+++ bindings/python/rhythmdb.override	(working copy)
@@ -717,17 +717,29 @@
 			Py_DECREF (obj);
 
 			obj = PySequence_GetItem (criteria, 2);
-			gtype = pyg_type_from_object ((PyObject *)obj->ob_type);
-			if (!gtype) {
-				PyErr_SetString (PyExc_TypeError, "can't map metadata to GType system");
-				return NULL;
+			if (propid == RHYTHMDB_PROP_TYPE) {
+				RhythmDBEntryType et;
+				if (pyg_boxed_check(obj, RHYTHMDB_TYPE_ENTRY_TYPE)) {
+					et = pyg_boxed_get(obj, RhythmDBEntryType_);
+				} else {
+					PyErr_SetString(PyExc_TypeError, "self should be a RhythmDBEntryType");
+					return NULL;
+				}
+				g_value_init (&value, rhythmdb_get_property_type (RHYTHMDB_RHYTHMDB(self->obj), propid));
+				g_value_set_pointer (&value, et);
+			} else {
+				gtype = pyg_type_from_object ((PyObject *)obj->ob_type);
+				if (!gtype) {
+					PyErr_SetString (PyExc_TypeError, "can't map metadata to GType system");
+					return NULL;
+				}
+				g_value_init (&value, gtype);
+				if (pyg_value_from_pyobject  (&value, obj) < 0) {
+					Py_XDECREF (obj);
+					PyErr_SetString (PyExc_TypeError, "could not access value for criteria");
+					return NULL;
+				}
 			}
-			g_value_init (&value, gtype);
-			if (pyg_value_from_pyobject  (&value, obj) < 0) {
-				Py_XDECREF (obj);
-				PyErr_SetString (PyExc_TypeError, "could not access value for criteria");
-				return NULL;
-			}
 			Py_DECREF (obj);
 			break;
 		}
