NamedKeyMapping¶
-
class
lsst.daf.butler.
NamedKeyMapping
¶ Bases:
collections.abc.Mapping
,typing.Generic
An abstract base class for custom mappings whose keys are objects with a
str
name
attribute, for which lookups on the name as well as the object are permitted.Notes
In addition to the new
names
property andbyName
method, this class simply redefines the type signature for__getitem__
andget
that would otherwise be inherited fromMapping
. That is only relevant for static type checking; the actual Python runtime doesn’t care about types at all.Attributes Summary
names
The set of names associated with the keys, in the same order ( AbstractSet
[str
]).Methods Summary
byName
()Return a Mapping
with names as keys and the same values asself
.get
(k[,d])items
()keys
()values
()Attributes Documentation
Methods Documentation
-
byName
() → Dict[str, V_co]¶ Return a
Mapping
with names as keys and the same values asself
.Returns:
-
get
(k[, d]) → D[k] if k in D, else d. d defaults to None.¶
-
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¶
-