Repository navigation
🤖🤖 Preserve observer definition order - #1001
LittleChenLiya wants to merge 3 commits into
Conversation
Register class-defined descriptors in declaration order so @observe handlers for the same trait run in the order they are defined. Refs ipython#874
Codecov Report❌ Patch coverage is
☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
vibhor-aggr
left a comment
There was a problem hiding this comment.
The mypy hook still allows argcomplete>=3.7, but removing these four ignores relies on argcomplete’s explicit mypy re-exports, released in 3.8. With 3.7.2, mypy 2.3.0 reports [attr-defined] for CompletionFinder, split_line, and the two debug calls in argcomplete_config.py.
Could you change just the mypy hook’s additional_dependencies in .pre-commit-config.yaml to ["argcomplete>=3.8"] alongside the cleanup? There is no need to change the package or test requirements. 🤖🤖
|
Updated the mypy hook additional_dependencies in .pre-commit-config.yaml to [argcomplete>=3.8], as suggested. |
Class-defined
@observehandlers were registered alphabetically because descriptor discovery used sorted member inspection. This made callbacks for the same trait run in method-name order rather than declaration order.Register descriptors declared on the class in class-body order while retaining the existing handling for inherited descriptors. Add a regression test using deliberately non-alphabetical observer names.
Refs #874
Validation:
tests/test_traitlets.py: 401 passed.🤖🤖