gigl.common.collections.SortedDict#

class gigl.common.collections.sorted_dict.SortedDict(*args, **kwargs)#

Bases: Mapping[KT, VT]

Sorted Dictionary implementation Given a dictionary, sorts it by keys when iterating over it

Methods

__init__

get

Retrieve the corresponding layout by the string key.

items

keys

values

classmethod __class_getitem__()#

Represent a PEP 585 generic type

E.g. for t = list[int], t.__origin__ is list and t.__args__ is (int,).

__eq__(other: object) bool#

Check equality against another object

Args:

other (object): Dictionary like object or SortedDict

Returns:

bool: Returns true if the current instance of frozen dict matches the other dictionary / frozen dict

__hash__ = None#
__init__(*args, **kwargs)#
__repr__()#

Return repr(self).

classmethod __subclasshook__(C)#

Abstract classes can override this to customize issubclass().

This is invoked early on by abc.ABCMeta.__subclasscheck__(). It should return True, False or NotImplemented. If it returns NotImplemented, the normal algorithm is used. Otherwise, it overrides the normal algorithm (and the outcome is cached).

__weakref__#

list of weak references to the object (if defined)

get(key, default=None)#

Retrieve the corresponding layout by the string key.

When there isn’t an exact match, all the existing keys in the layout map will be treated as a regex and map against the input key again. The first match will be returned, based on the key insertion order. Return None if there isn’t any match found.

Args:

key: the string key as the query for the layout.

Returns:

Corresponding layout based on the query.

items() a set-like object providing a view on D's items#
keys() a set-like object providing a view on D's keys#
values() an object providing a view on D's values#