class DistutilsExtensionArgs(collections.defaultdict):
"""
A special dictionary whose default values are the empty list.
This is useful for building up a set of arguments for
`distutils.Extension` without worrying whether the entry is
already present.
"""
def __init__(self, *args, **kwargs):
def default_factory():
return []
super(DistutilsExtensionArgs, self).__init__(
default_factory, *args, **kwargs)
def update(self, other):
for key, val in other.items():
self[key].extend(val)
This is in
astropy-helpers
and used to work here before everything was moved to top-level imports. Where did it go?https://github.com/astropy/astropy-helpers/blob/fc91b5f089a897d134d629b85e6ba57b27ed2b39/astropy_helpers/setup_helpers.py#L580-L597
xref spacetelescope/synphot_refactor#229