SimpleGenericMap#

class lsst.afw.typehandling.SimpleGenericMap(*args, **kwargs)#

Bases: MutableGenericMap

A dict-like MutableMapping for use when sharing a map between C++ and Python.

For compatibility with C++, SimpleGenericMap has the following restrictions:

  • all keys must be of the same type

  • values must be built-in types or subclasses of lsst.afw.typehandling.Storable. Almost any user-defined class in C++ or Python can have Storable as a mixin.

As a safety precaution, Storable objects that are added from C++ may be copied when you retrieve them from Python, making it impossible to modify them in-place. This issue does not affect objects that are added from Python, or objects that are always passed by shared_ptr in C++.

Parameters#

mapping : collections.abc.Mapping, optional iterable : iterable, optional dtype : type, optional

The type of key the map accepts. Not required if mapping or iterable is provided.

**kwargs

Aside from the dtype keyword, a SimpleGenericMap takes the same input arguments as dict.

Attributes Summary

Methods Summary

fromkeys(iterable[, value])

Attributes Documentation

TEMPLATE_DEFAULTS = (None,)#
TEMPLATE_PARAMS = ('dtype',)#

Methods Documentation

classmethod fromkeys(iterable, value=None)#