Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
bf25f77
Address builtin members by field offset
youknowone Sep 25, 2026
6e359ec
Address member review findings
youknowone Sep 25, 2026
77354be
Declare members on payload fields
youknowone Sep 25, 2026
73ab3c6
Split nullable and non-null atomic cells
youknowone Sep 25, 2026
1643d90
Drop the unused cold trace_lines flag
youknowone Sep 25, 2026
6343798
Compute payload offsets from the merged Py header
youknowone Sep 25, 2026
a7107ae
Expose descriptor names and owner types as members
youknowone Sep 26, 2026
1e11d57
Expose remaining builtin tp_members as members
youknowone Sep 26, 2026
a7fed73
Spell a docless member as doc = false
youknowone Sep 26, 2026
45fca72
Make pymember readonly by default
youknowone Sep 26, 2026
2c6228c
Check the receiver of method descriptors
youknowone Sep 26, 2026
1a57108
Expose exception attributes as members
youknowone Sep 26, 2026
149922f
Avoid same-type casts in unsigned member conversion
youknowone Sep 26, 2026
e4897b1
Prefer an explicit pymember doc over the doc table
youknowone Sep 26, 2026
9413c06
Infer pymember kinds from field types
youknowone Sep 26, 2026
9d33366
Read nullable atomic cells only through load_owned
youknowone Sep 26, 2026
eaeb57a
Inherit static type slots from the whole MRO
youknowone Sep 26, 2026
947e203
Let Rust doc comments win over stored docstrings
youknowone Sep 27, 2026
0c40a56
Adapt members to upstream changes
youknowone Sep 27, 2026
cb242d6
Drop docstring text left as comments and inline downcast_cell
youknowone Sep 27, 2026
72e8f8d
Read sqlite row factories through load_owned
youknowone Sep 27, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ Run `./scripts/whats_left.py` to get a list of unimplemented methods, which is h

- Do not delete or rewrite existing comments unless they are factually wrong or directly contradict the new code.
- Do not add decorative section separators (e.g. `// -----------`, `// ===`, `/* *** */`). Use `///` doc-comments or short `//` comments only when they add value.
- Do not put `///` doc comments on items annotated with `#[pyattr]`, `#[pyclass]`, or `#[pyfunction]`. The derive macros pull authoritative docstrings from CPython via the `rustpython-doc` crate; a Rust doc comment overrides that source, and on `#[pyattr]` it is silently dropped.
- A `///` doc comment on a Python-exposed item (`#[pyattr]`, `#[pyclass]`, `#[pyfunction]`, `#[pymethod]`, `#[pyclassmethod]`, `#[pystaticmethod]`, `#[pygetset]`, `#[pymember]`, `#[pyslot]`, `#[pyexception]`, `#[pymodule]`, `#[pystruct_sequence]`) is that item's docstring and overrides the stored docs in `rustpython-doc` (`crates/doc`). Those stored docs are used only when the item has no `///` comment. Developer notes on these items must be `//` comments.

#### Avoid Duplicate Code in Branches

Expand Down
4 changes: 2 additions & 2 deletions crates/capi/src/descrobject.rs
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,8 @@ impl PyMemberDef {
flags,
doc,
},
// `offset` is a byte offset from the object to a pointer cell.
access: MemberAccess::Slot,
// `offset` is a byte offset from the object to the field.
access: MemberAccess::Offset,
};

Ok(descriptor.into_ref(&vm.ctx))
Expand Down
27 changes: 27 additions & 0 deletions crates/common/src/atomic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,33 @@ impl<T> PyAtomicScalar for *mut T {
type Radium = atomic_ty!(*mut T, AtomicPtr<T>);
}

/// Atomic `f64`. The value is stored as its bits in an `AtomicU64`.
#[repr(transparent)]
pub struct AtomicF64 {
bits: AtomicU64,
}

impl AtomicF64 {
#[inline]
#[must_use]
pub const fn new(value: f64) -> Self {
Self {
bits: AtomicU64::new(value.to_bits()),
}
}

#[inline]
#[must_use]
pub fn load(&self, order: Ordering) -> f64 {
f64::from_bits(self.bits.load(order))
}

#[inline]
pub fn store(&self, value: f64, order: Ordering) {
self.bits.store(value.to_bits(), order);
}
}

pub struct OncePtr<T> {
inner: PyAtomic<*mut T>,
}
Expand Down
Loading
Loading