changeset 469:02b210a2b022

Docs
author Franz Glasner <fzglas.hg@dom66.de>
date Thu, 16 Dec 2021 09:19:50 +0100
parents 95df1a10259a
children b09b18b146e1
files configmix/config.py
diffstat 1 files changed, 14 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/configmix/config.py	Thu Dec 16 09:15:18 2021 +0100
+++ b/configmix/config.py	Thu Dec 16 09:19:50 2021 +0100
@@ -239,7 +239,7 @@
     """Flag to show that this is not a jail for another configuration"""
 
     def __getitem__(self, key):
-        """Mapping interface that forwards to :meth:`~.getvarl_s`
+        """Mapping and list interface that forwards to :meth:`~.getvarl_s`
 
         """
         if isinstance(key, (tuple, list)):
@@ -257,6 +257,7 @@
             return self.getvarl_s(key, default=default)
 
     def __contains__(self, key):
+        """Containment test"""
         if isinstance(key, (tuple, list)):
             # No namespace and quoting support here
             try:
@@ -850,6 +851,12 @@
                 % (self._path, ))
 
     def __getattr__(self, name):
+        """Attribute-style access.
+
+        Result values are interpolated (i.e. forwarded to
+        :meth:`~.getvarl_s`)
+
+        """
         try:
             v = self._base.getvarl_s(*(self._path + (name, )))
         except KeyError:
@@ -862,7 +869,7 @@
                 return v
 
     def __getitem__(self, key):
-        """Mapping interface that forwards to :meth:`~.getvarl_s`
+        """Mapping and list interface that forwards to :meth:`~.getvarl_s`
 
         """
         if isinstance(key, tuple):
@@ -881,6 +888,7 @@
             return self._base.get(self._path + (key, ), default=default)
 
     def __contains__(self, key):
+        """Containment support for containers"""
         if isinstance(key, tuple):
             return (self._path + key) in self._base
         elif isinstance(key, list):
@@ -941,19 +949,23 @@
         return self._base.getfirstvar_s(*real_varnames, **kwds)
 
     def __iter__(self):
+        """Iteration support for containers"""
         return iter(self._base.getvarl_s(*self._path))
 
     def __len__(self):
+        """Length support for containers"""
         return len(self._base.getvarl(*self._path))
 
     if PY2:
 
         def __nonzero__(self):
+            """Map- and list-style evaluation in boolean context"""
             return bool(self._base.getvarl_s(*self._path))
 
     else:
 
         def __bool__(self):
+            """Map- and list-style evaluation in boolean context"""
             return bool(self._base.getvarl_s(*self._path))
 
     def jailed(self, rootpath=None, root=None, bind_root=True):