From 5074b30dbed0cb3c29baa50d03cb26f6a2193606 Mon Sep 17 00:00:00 2001 From: Sparrel <63410001+Sparrel@users.noreply.github.com> Date: Thu, 27 Feb 2025 11:29:11 +0100 Subject: [PATCH] Add __setattr__ --- libconf.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libconf.py b/libconf.py index 4f546c0..5e7373d 100644 --- a/libconf.py +++ b/libconf.py @@ -70,6 +70,10 @@ def __getattr__(self, attr): except KeyError: raise AttributeError("Attribute %r not found" % attr) + def __setattr__(self, attr, value): + # Allow setting attributes via attribute access + self.__setitem__(attr, value) + class ConfigParseError(RuntimeError): '''Exception class raised on errors reading the libconfig input'''