| 1297 | """The base class for all classes that have descriptors.""" |
| 1298 | |
| 1299 | def __new__(cls, /, *args: t.Any, **kwargs: t.Any) -> Self: |
| 1300 | # This is needed because object.__new__ only accepts |
| 1301 | # the cls argument. |
| 1302 | new_meth = super(HasDescriptors, cls).__new__ |
| 1303 | if new_meth is object.__new__: |
| 1304 | inst = new_meth(cls) |
| 1305 | else: |
| 1306 | inst = new_meth(cls, *args, **kwargs) |
| 1307 | inst.setup_instance(*args, **kwargs) |
| 1308 | return inst |
| 1309 | |
| 1310 | def setup_instance(self, /, *args: t.Any, **kwargs: t.Any) -> None: |
| 1311 | """ |