pg.utils.StrKey¶
Accessible via pg.utils.StrKey.
- class StrKey[source]¶
Bases:
objectInterface for classes whose instances can be treated as str in
KeyPath.A
pg.KeyPathwill format the path string using.(dot) as the delimiter for a key represented by this object. Otherwise[](square brackets) will be used as the delimiters.Example:
class MyKey(pg.utils.StrKey): def __init__(self, name): self.name = name def __str__(self): return f'__{self.name}__' path = pg.KeyPath(['a', MyKey('b')]) print(str(path)) # Should print "a.__b__"