Lines Matching refs:key

72     item_accessor operator[](handle key) const;
73 /// See above (the only difference is that they key is provided as a string literal)
74 item_accessor operator[](const char *key) const;
82 obj_attr_accessor attr(handle key) const;
83 /// See above (the only difference is that they key is provided as a string literal)
84 str_attr_accessor attr(const char *key) const;
479 accessor(handle obj, key_type key) : obj(obj), key(std::move(key)) { }
489 Policy::set(obj, key, object_or_cast(std::forward<T>(value)));
499 return hasattr(obj, key);
502 PYBIND11_DEPRECATED("Use of obj[key] as bool is deprecated in favor of obj.contains(key)")
504 return obj.contains(key);
513 if (!cache) { cache = Policy::get(obj, key); }
519 key_type key;
526 static object get(handle obj, handle key) { return getattr(obj, key); }
527 static void set(handle obj, handle key, handle val) { setattr(obj, key, val); }
532 static object get(handle obj, const char *key) { return getattr(obj, key); }
533 static void set(handle obj, const char *key, handle val) { setattr(obj, key, val); }
539 static object get(handle obj, handle key) {
540 PyObject *result = PyObject_GetItem(obj.ptr(), key.ptr());
545 static void set(handle obj, handle key, handle val) {
546 if (PyObject_SetItem(obj.ptr(), key.ptr(), val.ptr()) != 0) { throw error_already_set(); }
705 reference dereference() const { return {key, value}; }
706 void increment() { if (!PyDict_Next(obj.ptr(), &pos, &key, &value)) { pos = -1; } }
711 PyObject *key = nullptr, *value = nullptr;
1229 template <typename T> bool contains(T &&key) const {
1230 return PyDict_Contains(m_ptr, detail::object_or_cast(std::forward<T>(key)).ptr()) == 1;
1405 template <typename D> item_accessor object_api<D>::operator[](handle key) const {
1406 return {derived(), reinterpret_borrow<object>(key)};
1408 template <typename D> item_accessor object_api<D>::operator[](const char *key) const {
1409 return {derived(), pybind11::str(key)};
1411 template <typename D> obj_attr_accessor object_api<D>::attr(handle key) const {
1412 return {derived(), reinterpret_borrow<object>(key)};
1414 template <typename D> str_attr_accessor object_api<D>::attr(const char *key) const {
1415 return {derived(), key};