Resolve on_class targets from __qualname__ - #267
Closed
dima179-fuse wants to merge 3 commits into
Closed
dima179-fuse wants to merge 3 commits into
dima179-fuse wants to merge 3 commits into
Conversation
cjw296
reviewed
Sep 23, 2026
| Accessor = Callable[[Any, str], Any] | ||
|
|
||
|
|
||
| def _class_from_qualname(attribute: Any, name: str | None) -> type | None: |
Member
There was a problem hiding this comment.
coverage is missing, see CI failures, but also I wonder how much of this can be handed off to resolve instead.
dima179-fuse
marked this pull request as ready for review
September 23, 2026 14:29
get_referrers walks every live object, so replacing one method in a large test process took hundreds of milliseconds. A class reachable from its module is named by __qualname__, so resolve that class directly and keep the heap scan for classes defined inside functions. Co-authored-by: Dmitry Voronetskiy <dima179-fuse@users.noreply.github.com>
cursor
Bot
force-pushed
the
cursor/dima179-faster-on-class-be7e
branch
from
September 23, 2026 14:29
62b191f to
916fdb7
Compare
Cover a module dropped from sys.modules, a class name rebound to an instance, and a class left behind by a module reload, instead of calling the private helper with mocks. Co-authored-by: Dmitry Voronetskiy <dima179-fuse@users.noreply.github.com>
Co-authored-by: Dmitry Voronetskiy <dima179-fuse@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
get_referrers walks every live object, so replacing one method in a large test process took hundreds of milliseconds. A class reachable from its module is named by qualname, so resolve that class directly and keep the heap scan for classes defined inside functions.