Note: This code and documentation are incomplete.
-
namedtuple
- Docs: https://docs.python.org/2/library/collections.html#collections.namedtuple
- Source: https://hg.python.org/cpython/file/2.7/Lib/collections.py#l305
- The
rename
argument is interesting. It replaces key names that meet certain criteria, (repeated, is a reserved word, etc.) with the index number instead. A useful idea for my own classes that allow names that haven't been predefined. However, rather than using an index number, use an altered form of the name, like "_unsafeKey_%s".
-
Namespace
-
Source: https://hg.python.org/cpython/file/2.7/Lib/argparse.py#l1153