| 203 | """ |
| 204 | |
| 205 | def __init__(self, *args, **kwargs) -> None: |
| 206 | pos = kwargs.pop("pos", None) |
| 207 | col_attrs = kwargs.pop("attrs", {}) |
| 208 | offset = kwargs.pop("_offset", None) |
| 209 | class_from_prefix = self._class_from_prefix |
| 210 | atombase.__init__(self, *args, **kwargs) |
| 211 | # The constructor of an abstract atom may have changed |
| 212 | # the class of `self` to something different of `NewCol` |
| 213 | # and `atombase` (that's why the prefix map is saved). |
| 214 | if self.__class__ is not NewCol: |
| 215 | colclass = class_from_prefix[self.prefix()] |
| 216 | self.__class__ = colclass |
| 217 | self._v_pos = pos |
| 218 | self._v_offset = offset |
| 219 | self._v_col_attrs = col_attrs |
| 220 | |
| 221 | __eq__ = same_position(atombase.__eq__) |
| 222 | _is_equal_to_atom = same_position(atombase._is_equal_to_atom) |