Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: GrahamDumpleton/wrapt
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 2.2.0
Choose a base ref
...
head repository: GrahamDumpleton/wrapt
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 2.2.1
Choose a head ref
  • 13 commits
  • 7 files changed
  • 2 contributors

Commits on May 21, 2026

  1. Merge tag '2.2.0' into develop

    no message
    GrahamDumpleton committed May 21, 2026
    Configuration menu
    Copy the full SHA
    4306cdd View commit details
    Browse the repository at this point in the history
  2. Document deriving from ObjectProxy alongside an ABCMeta-based class.

    Adds a known-issues entry covering the TypeError raised by
    ObjectProxy.__subclasscheck__ when ObjectProxy is mixed in as a base
    class alongside an abstract base class such as Hashable or any other
    ABCMeta-based class. Explains the cause, why the runtime inheritance is
    typically redundant for the type-checker-driven cases where this is
    attempted, and recommends typing.Protocol at the annotation site or a
    TYPE_CHECKING-guarded class declaration as the appropriate alternatives.
    GrahamDumpleton committed May 21, 2026
    Configuration menu
    Copy the full SHA
    8799b4b View commit details
    Browse the repository at this point in the history

Commits on May 22, 2026

  1. Add API reference page describing the public API contract.

    Documents that only names re-exported from the top-level wrapt module
    are public, lists each entry in __all__ with a brief description and
    links into the rest of the docs, explains why type hints require
    importing from wrapt, and covers the C extension fallback behaviour
    along with the WRAPT_DISABLE_EXTENSIONS and WRAPT_INSTALL_EXTENSIONS
    environment variables.
    GrahamDumpleton committed May 22, 2026
    Configuration menu
    Copy the full SHA
    b0a7650 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    0dbbba1 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    f8d4a2e View commit details
    Browse the repository at this point in the history
  4. Revert Py_None substitution in C FunctionWrapper.__get__.

    The change in 2.2.0 which substituted Py_None for NULL before invoking the
    wrapped descriptor's tp_descr_get slot was based on a misreading of what
    the pure Python path does once it crosses back into C. The pure Python
    path calls __get__ from Python and CPython's slot wrapper converts Py_None
    back to NULL before the wrapped descriptor's tp_descr_get is invoked, so
    the pre 2.2.0 C path which passed obj through unchanged was already
    producing the matching value. Substituting Py_None directly bypassed that
    conversion and caused native CPython descriptors which fast path on NULL
    to fall through to a type check against the owner type and raise
    TypeError. Move the Py_None substitution back to where it was, right
    before constructing the BoundFunctionWrapper, so the wrapped descriptor
    sees the obj value unchanged. Add a regression test which wraps a native
    descriptor and exercises class attribute access, covering the gap which
    allowed the regression through.
    GrahamDumpleton committed May 22, 2026
    Configuration menu
    Copy the full SHA
    0583a12 View commit details
    Browse the repository at this point in the history
  5. Merge pull request #341 from brettlangdon/brettlangdon/descriptor.tests

    Add test coverage for native descriptors
    GrahamDumpleton authored May 22, 2026
    Configuration menu
    Copy the full SHA
    daddcfe View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    00541d5 View commit details
    Browse the repository at this point in the history
  7. Run descriptor __get__ tests against both implementations.

    The descriptor __get__ tests added in PR #341 were marked C extension only,
    which restricted them to one half of the tox matrix and gave no coverage
    of the pure Python FunctionWrapper.__get__ code path. The bug they guard
    against only manifests in the C extension because Python's own __get__
    slot wrapper performs the Py_None to NULL conversion before the wrapped
    descriptor is invoked on the pure Python path, but the behavioural
    assertions are valid for both implementations and the disable-extensions
    tox environments are the right mechanism for running the suite against
    the pure Python wrapper.
    
    Drop the @c_extension_only skip decorators so the descriptor tests run
    under both the C and pure Python wrapper variants of the tox matrix. Drop
    the explicit TestPurePythonWraptPath cases as well: they were only useful
    while everything else in the file was C extension only, and the disable
    extensions runs in tox and just now exercise the pure Python wrapper for
    every test in the file.
    
    Drop the TestNativeDescriptorBinding regression cases from
    test_function_wrapper.py, since they are a strict subset of the cases now
    running against both implementations from test_descriptor_get_class_access.
    
    Expand the module level docstring and add per class comments to describe
    what each descriptor type test class covers and why it matters.
    GrahamDumpleton committed May 22, 2026
    Configuration menu
    Copy the full SHA
    94bd940 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    86f4e0e View commit details
    Browse the repository at this point in the history
  9. Skip CPython specific descriptor tests on PyPy.

    PyPy does not ship the ``_pickle`` C module used to obtain a C extension
    backed slot wrapper, so import of the descriptor tests fails at
    collection time on PyPy. Beyond the missing module, the native CPython
    descriptor types exercised here (wrapper_descriptor, method_descriptor,
    classmethod_descriptor, getset_descriptor, member_descriptor) are CPython
    implementation details which PyPy does not expose as the same distinct
    types. The regression these tests guard against is also specific to the
    wrapt C extension which is not built on PyPy.
    
    Detect PyPy via ``platform.python_implementation()`` and skip the test
    classes covering native CPython descriptors and the two subclass
    attribute access tests which wrap a native slot wrapper. The Python
    level descriptor tests (property, classmethod, staticmethod, custom
    user defined descriptor, plain Python method) continue to run on PyPy.
    Guard the ``_pickle`` import behind the same flag so the module loads
    on PyPy in the first place.
    GrahamDumpleton committed May 22, 2026
    Configuration menu
    Copy the full SHA
    d89dce9 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    da8f21f View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    787db02 View commit details
    Browse the repository at this point in the history
Loading