Repository: childsish/dynamic-yaml

Issue:
'YamlDict' has no __delattr__ method
Is there a reason __delattr__ isn't implemented on YamlDict?
It was a bit surprising to try to delete an attribute and have it raise.

Discussion:

Patch:
diff --git a/dynamic_yaml/yaml_wrappers.py b/dynamic_yaml/yaml_wrappers.py
index 34ca7e8..2522118 100644
--- a/dynamic_yaml/yaml_wrappers.py
+++ b/dynamic_yaml/yaml_wrappers.py
@@ -66,6 +66,9 @@ class YamlDict(DynamicYamlObject, MutableMapping):
     def __setattr__(self, key, value):
         self[key] = value
 
+    def __delattr__(self, key):
+        del self[key]
+
     def _values(self):
         return super().__getattribute__('_collection').values()
 
diff --git a/pyproject.toml b/pyproject.toml
index c8ad8cb..842ede4 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
 
 [project]
 name = "dynamic-yaml"
-version = "1.3.3"
+version = "1.3.4"
 description = "Enables self referential yaml entries"
 readme = "README.md"
 authors = [{ name = "Liam H. Childs", email = "liam.h.childs@gmail.com" }]


Test patch:
diff --git a/tests/test_dynamic_yaml.py b/tests/test_dynamic_yaml.py
index cd4302b..e85e0bd 100644
--- a/tests/test_dynamic_yaml.py
+++ b/tests/test_dynamic_yaml.py
@@ -37,6 +37,21 @@ class TestDynamicYaml(TestCase):
         self.assertEqual(1, res.a)
         self.assertEqual(2, res.b)
         self.assertEqual('a', res.c)
+
+        del res['a']
+        self.assertNotIn('a', res)
+        self.assertFalse(hasattr(res, 'a'))
+        self.assertEqual(2, res.b)
+        self.assertEqual('a', res.c)
+
+        del res.b
+        self.assertNotIn('b', res)
+        self.assertFalse(hasattr(res, 'b'))
+        self.assertEqual('a', res.c)
+
+        delattr(res, 'c')
+        self.assertNotIn('c', res)
+        self.assertFalse(hasattr(res, 'c'))
     
     def test_nested_dict(self):
         config = '''