| 381 | index=siblings.index(self)) |
| 382 | |
| 383 | def __dir__(self): |
| 384 | out_dir = set() |
| 385 | classes = (type(self),) |
| 386 | while classes: |
| 387 | super_classes = set() |
| 388 | for klass in classes: |
| 389 | out_dir.update(klass.__dict__) |
| 390 | super_classes.update(klass.__bases__) |
| 391 | classes = super_classes |
| 392 | out_dir.update(self._spec.children) |
| 393 | out_dir.update(self._spec.attributes) |
| 394 | if constants.CLASS in out_dir: |
| 395 | out_dir.remove(constants.CLASS) |
| 396 | out_dir.add(constants.DCLASS) |
| 397 | return sorted(out_dir) |
| 398 | |
| 399 | def find(self, namespace, identifier): |
| 400 | """Finds an element with a particular identifier. |