Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added as_super methods to PyRef and PyRefMut. #4219

Merged
merged 16 commits into from
Jun 9, 2024

Commits on May 28, 2024

  1. Added PyRef::as_super and PyRefMut::as_super methods, including d…

    …ocstrings and tests. The implementation of these methods also required adding `#[repr(transparent)]` to the `PyRef` and `PyRefMut` structs.
    JRRudy1 committed May 28, 2024
    Configuration menu
    Copy the full SHA
    477fa6f View commit details
    Browse the repository at this point in the history
  2. Added newsfragment entry.

    JRRudy1 committed May 28, 2024
    Configuration menu
    Copy the full SHA
    6d27b2d View commit details
    Browse the repository at this point in the history
  3. Changed the AsRef<U>/AsMut<U> impls for PyRef and PyRefMut to…

    … use the new `as_super` methods. Added the `PyRefMut::downgrade` associated function for converting `&PyRefMut` to `&PyRef`. Updated tests and docstrings to better demonstrate the new functionality.
    JRRudy1 committed May 28, 2024
    Configuration menu
    Copy the full SHA
    42d7ca9 View commit details
    Browse the repository at this point in the history

Commits on May 29, 2024

  1. Fixed newsfragment filename.

    JRRudy1 committed May 29, 2024
    Configuration menu
    Copy the full SHA
    189d92e View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    6596cd6 View commit details
    Browse the repository at this point in the history
  3. retrigger checks

    JRRudy1 committed May 29, 2024
    Configuration menu
    Copy the full SHA
    8c44d28 View commit details
    Browse the repository at this point in the history

Commits on Jun 8, 2024

  1. Updated PyRef::as_super, PyRefMut::as_super, and `PyRefMut::downg…

    …rade` to use `.cast()` instead of `as _` pointer casts. Fixed typo.
    JRRudy1 committed Jun 8, 2024
    Configuration menu
    Copy the full SHA
    23c7836 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    58a6ee7 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    e97b28a View commit details
    Browse the repository at this point in the history
  4. Updated PyRef::as_super and PyRefMut::downgrade to use `ptr_from_…

    …ref` for the initial cast to `*const _` instead of `as _` casts.
    JRRudy1 committed Jun 8, 2024
    Configuration menu
    Copy the full SHA
    4e345f3 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    6bef736 View commit details
    Browse the repository at this point in the history
  6. Added pyo3::internal_tricks::ptr_from_mut function alongside the `p…

    …tr_from_ref` added in PR PyO3#4240. Updated `PyRefMut::as_super` to use this method instead of `as *mut _`.
    JRRudy1 committed Jun 8, 2024
    Configuration menu
    Copy the full SHA
    9c32d77 View commit details
    Browse the repository at this point in the history
  7. Updated the user guide to recommend as_super for accessing the base…

    … class instead of `as_ref`, and updated the subsequent example/doctest to demonstrate this functionality.
    JRRudy1 committed Jun 8, 2024
    Configuration menu
    Copy the full SHA
    1d3e41a View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    bf4e872 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    0fc9143 View commit details
    Browse the repository at this point in the history
  10. Fixed formatting.

    JRRudy1 committed Jun 8, 2024
    Configuration menu
    Copy the full SHA
    f85c83a View commit details
    Browse the repository at this point in the history