IndexedDict#
- class astropop.py_utils.IndexedDict#
Bases:
dict
Extends Python dictionary to include indexing and inserting.
Python3.7 keeps assignment ordering in default dict, like OrderedDict.
Methods Summary
index
(key)Return the index of a key in the list.
insert_after
(key, new_key, val)Insert new_key:value into dict after key.
insert_at
(index, key, value)Insert a key:value to an specific index.
insert_before
(key, new_key, val)Insert new_key:value into dict before key.
Methods Documentation
- index(key)#
Return the index of a key in the list.
- insert_after(key, new_key, val)#
Insert new_key:value into dict after key.
- insert_at(index, key, value)#
Insert a key:value to an specific index.
- insert_before(key, new_key, val)#
Insert new_key:value into dict before key.