* Prevent building in GIL-less environment
* Add change log
* add "yet" to phrasing
* Add testing to build script
* add link to issue
* Fix formatting issues
---------
Co-authored-by: David Hewitt <mail@davidhewitt.dev>
* implement PartialEq for Pybool
implement PartialEq for Pybool
* fix failing cargodoc and add changelog file
* Use PR number for change log file
* Add false checking into test
* Revamp PyType name functions to match PEP 737
PyType::name uses `tp_name`, which is not consistent.
[PEP 737](https://peps.python.org/pep-0737/) adds a new path forward,
so update PyType::name and add PyType::{module,fully_qualified_name}
to match the PEP.
* refactor conditional code to handle multiple Python versions better
* return `Bound<'py, str>`
* fixup
---------
Co-authored-by: David Hewitt <mail@davidhewitt.dev>
* attemp to fix range for st.datetime
* remove example
* try fixing to utc
* make datetime from timestamp tests compare against Python result
---------
Co-authored-by: Cheukting <cheukting.ho@gmail.com>
* Copy pasta implementation from types/string.rs
* changelog
* I think I don't need a special implementation for 3.10 or ABI
* Copy pasta tests
* Fix comment with correct type
Co-authored-by: Icxolu <10486322+Icxolu@users.noreply.github.com>
* Fix implementation
* Use slice in tests
* Try renaming changelog file
* Fix doc example
* Fix doc example
Co-authored-by: Icxolu <10486322+Icxolu@users.noreply.github.com>
---------
Co-authored-by: Icxolu <10486322+Icxolu@users.noreply.github.com>
* Change `search_lib_dir`'s return type to Result
* add changelog
* add coverage and a hint to `PYO3_CROSS_LIB_DIR`
---------
Co-authored-by: David Hewitt <mail@davidhewitt.dev>
* use `ffi::MemberGef` for `#[pyo3(get)]` fields of `Py<T>`
* tidy up implementation
* make it work on MSRV :(
* fix docs and newsfragment
* clippy
* internal docs and coverage
* review: mejrs
* emit c-string literals on Rust 1.77 or later
* only clone `PyO3CratePath` instead of the whole `Ctx`
Co-authored-by: mejrs <59372212+mejrs@users.noreply.github.com>
---------
Co-authored-by: mejrs <59372212+mejrs@users.noreply.github.com>
Co-authored-by: David Hewitt <mail@davidhewitt.dev>
* Improve the span and message for return types of pymethod/functions
* Don't pass the span
* fixup trybuild output
---------
Co-authored-by: David Hewitt <mail@davidhewitt.dev>
* Added `PyRef::as_super` and `PyRefMut::as_super` methods, including docstrings and tests. The implementation of these methods also required adding `#[repr(transparent)]` to the `PyRef` and `PyRefMut` structs.
* Added newsfragment entry.
* 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.
* Fixed newsfragment filename.
* Removed unnecessary re-borrows flagged by clippy.
* retrigger checks
* Updated `PyRef::as_super`, `PyRefMut::as_super`, and `PyRefMut::downgrade` to use `.cast()` instead of `as _` pointer casts. Fixed typo.
* Updated `PyRef::as_super` and `PyRefMut::downgrade` to use `ptr_from_ref` for the initial cast to `*const _` instead of `as _` casts.
* Added `pyo3::internal_tricks::ptr_from_mut` function alongside the `ptr_from_ref` added in PR #4240. Updated `PyRefMut::as_super` to use this method instead of `as *mut _`.
* 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.
* Improved tests for the `as_super` methods.
* Updated newsfragment to include additional changes.
* Fixed formatting.
---------
Co-authored-by: jrudolph <jrudolph@anl.gov>