File tree 1 file changed +8
-1
lines changed 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -388,6 +388,14 @@ inline bool hasattr(handle obj, const char *name) {
388
388
return PyObject_HasAttrString (obj.ptr (), name) == 1 ;
389
389
}
390
390
391
+ inline void delattr (handle obj, handle name) {
392
+ if (PyObject_DelAttr (obj.ptr (), name.ptr ()) != 0 ) { throw error_already_set (); }
393
+ }
394
+
395
+ inline void delattr (handle obj, const char *name) {
396
+ if (PyObject_DelAttrString (obj.ptr (), name) != 0 ) { throw error_already_set (); }
397
+ }
398
+
391
399
inline object getattr (handle obj, handle name) {
392
400
PyObject *result = PyObject_GetAttr (obj.ptr (), name.ptr ());
393
401
if (!result) { throw error_already_set (); }
@@ -459,7 +467,6 @@ object object_or_cast(T &&o);
459
467
// Match a PyObject*, which we want to convert directly to handle via its converting constructor
460
468
inline handle object_or_cast (PyObject *ptr) { return ptr; }
461
469
462
-
463
470
template <typename Policy>
464
471
class accessor : public object_api <accessor<Policy>> {
465
472
using key_type = typename Policy::key_type;
You can’t perform that action at this time.
0 commit comments