Skip to content

Add change note and tests for omitted owner in proxy descriptor binding - #355

Merged
GrahamDumpleton merged 1 commit into
developfrom
docs/changes-optional-descriptor-owner
Sep 20, 2026
Merged

GrahamDumpleton merged 1 commit into
developfrom
docs/changes-optional-descriptor-owner

Conversation

@GrahamDumpleton

Copy link
Copy Markdown
Owner

Follow up to #352, which made the owner argument of __get__() optional
on AutoObjectProxy and LazyObjectProxy. That PR was merged as
submitted. This adds the release note for it, along with a couple of
additional tests. There are no changes to src/wrapt/.

Changes

  • Changelog entry under Bugs Fixed for 2.4.2 describing the fix made
    in Allow omitted owner in proxy descriptor binding #352.
  • New test, for both AutoObjectProxy and LazyObjectProxy, using a
    descriptor implemented in Python whose __get__() requires the owner
    argument. The tests in Allow omitted owner in proxy descriptor binding #352 use a function and a property, where the
    __get__() of the wrapped object itself accepts owner being omitted.
    For a descriptor implemented in Python which requires it, it is the
    None passed on by the proxy which makes the one argument form work.
    The test checks that the wrapped descriptor receives None for owner
    when it is omitted, and that an owner which is supplied is still
    passed through as is.
  • test_get_added_on_reassignment now also calls __get__() using the
    one argument form. This covers the case where __get__() is only added
    to the proxy as a result of __wrapped__ being reassigned to a
    descriptor, where previously the test only checked that the method
    existed.

Verification

just test was run across the full matrix (3.9 to 3.15, three variants
each) against develop after #352 was merged, and passed. For the
additional tests in this PR, just test-version 3.13 passes in all three
variants. The full matrix was not rerun locally for this PR since only
tests and documentation are changed, and is left to CI.

@GrahamDumpleton
GrahamDumpleton merged commit 24bd836 into develop Sep 20, 2026
49 checks passed
@GrahamDumpleton
GrahamDumpleton deleted the docs/changes-optional-descriptor-owner branch September 20, 2026 10:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant