| 237 | return NewCol |
| 238 | |
| 239 | def __repr__(self) -> str: |
| 240 | # Reuse the atom representation. |
| 241 | atomrepr = super().__repr__() |
| 242 | lpar = atomrepr.index("(") |
| 243 | rpar = atomrepr.rindex(")") |
| 244 | atomargs = atomrepr[lpar + 1 : rpar] |
| 245 | classname = self.__class__.__name__ |
| 246 | if self._v_col_attrs: |
| 247 | return ( |
| 248 | f"{classname}({atomargs}, pos={self._v_pos}" |
| 249 | f", attrs={self._v_col_attrs})" |
| 250 | ) |
| 251 | return f"{classname}({atomargs}, pos={self._v_pos})" |
| 252 | |
| 253 | def _get_init_args(self) -> dict[str, Any]: |
| 254 | """Get a dictionary of instance constructor arguments.""" |