In crates/vm, #[pyclass] impl blocks whose Python methods or getset
descriptors took &self are moved to impl Py<T>, so those items receive the
object instead of the payload. Non-Python helpers stay in impl T. Where Rust
code calls one of these methods on a payload value, the logic stays in a
payload method and the Python method forwards to it.
#[pymethod] and #[pygetset] items in the vm #[pyclass] traits (the dict view
traits and the _io buffered mixins) take zelf: &Py<Self> instead of &self.
Assisted-by: Claude Code:claude-opus-5-5
Assisted-by: Grok:grok-4.7
* Set builtin __doc__, __module__, and datetime signatures
Expose empty doc-db member entries as ''. Heap __dict__ and __weakref__
getsets carry their descriptor docs. Member repr uses the qualified
type name.
__module__ is collections for the deque iterators, _csv for Dialect,
ctypes for ArgumentError and CField, _lzma for LZMAError, operator for
the getter types, pickle for PickleBuffer, _ssl for MemoryBIO,
SSLSession, _SSLContext and _SSLSocket, weakref for the proxy types,
and posix (nt on Windows) for times_result and uname_result.
unicodedata's copied UCD functions set __module__ to unicodedata.
_testinternalcapi function docs and weakproxy.__str__ use the stored
text. datetime replace defaults render as unchanged, __replace__ is
($self, /, **changes) and binds through replace, now defaults tz to
None, and fromisoformat and tzinfo methods name the parameter object.
Assisted-by: Grok:grok-4.7
* Move doctext helpers above the test module
db_slice and docs sat after mod tests.
Remove expectedFailure from test_html_doc, test_text_doc,
test_help_output_redirect, test_method_aliases, and test_long_signatures.
Assisted-by: Grok:grok-4.7
- Problem: without the threading feature, sending a non-contiguous or
non-byte-format memoryview through _interpchannels loses its data or
metadata on the receiving end
- Cause: the no-threading path copied only the contiguous bytes and
discarded the buffer's descriptor, reconstructing everything as flat bytes
- Fix: copy the whole backing memory plus its BufferDescriptor, and
reconstruct with that descriptor instead of a byte-only default
Assisted-by: Claude Code:claude-sonnet-5
Signed-off-by: Jiwoo Ahn <ikwydls1314@gmail.com>
* fix(gc): traverse annotate name and qualname fields in PyFunction
* style: format extra_tests/snippets/stdlib_gc.py
Assisted-by: Antigravity:Gemini-3.8-Flash
* Record native docstrings the doc DB generator skipped
- Stop ignoring `__dir__`; skip `__base__`, `__bases__` and `__module__` instead.
- Recurse into native classes whose metaclass is not `type`, and also key a
class stored under another attribute name by its own `__name__`.
- Collect native objects exposed by pure-Python modules, such as the codec
error handlers, under their own `__module__` and `__name__`.
- Key types found through `object.__subclasses__()` by their own module as
well as `builtins`.
- Record getset/member descriptors named like class metadata
(`coroutine.__name__`), and native types a module exposes only through an
instance (`sys.flags`).
- Treat a class as native only when it owns its C descriptors, so an enum
holding a copied `str.__format__` is skipped.
- Keep docstrings unstripped, and import every module in sorted order before
walking them.
- Apply the resulting key delta, measured on macOS with CPython 3.14.7, to
data.inc.rs.
Assisted-by: Claude:claude-opus-5-5
Assisted-by: Grok:grok-4.7
* Stop Rust comments on Python items from becoming __doc__
Use `//` instead of `///` on Python-exposed items so their comments are not
published as `__doc__`.
Assisted-by: Claude:claude-opus-5-5
Assisted-by: Grok:grok-4.7
* Match native names, signatures and doc lookup
- Rename the weakref type to `weakref.ReferenceType` and define
`__class_getitem__` on `_ctypes.Array` instead of its metaclass.
- Give each name of a multi-name `#[pymodule(sub)]` function
(`posix.remove`/`unlink`) its database doc.
- Fill methods from `with(...)` traits (dict view `__reversed__`,
`isdisjoint`) with the implementing class's database doc.
- Resolve database docs for `#[pymodule]` classes at macro time, and for the
codec error handlers and `_lzma.LZMAError` in const context.
- Add `Context::new_exception_type_with_doc`.
- Match `posix_spawn` parameter names and defaults, make `dict_keys` and
`dict_items` unhashable, add `_CData.__ctypes_from_outparam__`, and omit
the Windows-only lines of `sys.__doc__` on other platforms.
Assisted-by: Claude:claude-opus-5-5
Assisted-by: Grok:grok-4.7
* Give struct sequence fields their database docs
`new_readonly_tuple_member` takes the field doc, looked up in the class's
attribute doc table through the new `class_attr_item_doc`.
Assisted-by: Claude:claude-opus-5-5
* Look up pymodule(sub) docs by an explicit module name
posix and nt share one doc entry. A sub module sets name to the
Python module it is merged into, and doc lookup uses that name.
Assisted-by: Claude:claude-opus-5-5
Assisted-by: Grok:grok-4.7
* Record pending class doc bodies on PyMethodDef
The pymethod derive sets doc_body_pending when a method has no Rust
doc body and expansion did not resolve a database span.
concat_with_attr_docs copies that span from the class table and
clears the flag. Other constructors leave the flag false.
Assisted-by: Claude:claude-opus-5-5
Assisted-by: Grok:grok-4.7
* Name argument fields after their Python parameters
PosixSpawnArgs.args is renamed to argv, and nt's follow_symlinks field
drops a name override equal to the field name.
Assisted-by: Claude:claude-opus-5-5
type_slot_names reads __slotnames__ from the type's own dict before
calling copyreg._slotnames, and rejects a cached value that is not a
list or None. object_getstate_default no longer replaces errors from
type_slot_names with TypeError("cannot pickle object"), so a
RecursionError raised there propagates.
Assisted-by: Claude:claude-opus-5-5
* Address review findings on member descriptors
Member definitions carry an internal `PY_ATOMIC` flag taken from
`MemberLayout::ATOMIC`, and loads use an atomic access only for atomic
storage; extension members never set it. `XMLParser` publishes its new
state, `entity` and `target` only after every handler lookup succeeds.
`subs_parameters` reads type names only for the error. The unraisable
hook prints `<unknown>` when `__module__` fails or is not a str. The
builtin function `__reduce__` decides on the bound object alone.
Assisted-by: Grok:4.7
Assisted-by: Claude:claude-opus-5-5
* Fix member layout assertions on 32-bit targets
The tp_flags assertion compared AtomicU64 with u64 alignment, which differs
on i686. The kevent assertion required usize, isize, c_ulong and c_long to be
64-bit. Both now check only what the member cells need.
Assisted-by: Grok:4.7
Assisted-by: Claude:claude-opus-5-5
* Use bitflags for member definition flags
PY_READONLY, PY_AUDIT_READ, PY_RELATIVE_OFFSET and PY_ATOMIC become the
repr(transparent) PyMemberFlags. C extension flags are read with
from_bits_retain.
Assisted-by: Grok:4.7
Assisted-by: Claude:claude-opus-5-5
Use `//` instead of `///` on Python-exposed items so their comments are not
published as `__doc__`.
Assisted-by: Claude:claude-opus-5-5
Assisted-by: Grok:grok-4.7
* fix(contextvars): isolate context stack per interpreter and thread on VirtualMachine
* style: format and sort imports in extra_tests/snippets/stdlib_contextvars.py
Assisted-by: Antigravity:Gemini-3.8-Flash
A Cargo.lock change no longer forces the cross-target cargo check by
itself. The check runs when the lock diff adds lines, or when a removed
package is still referenced from Rust sources.
Assisted-by: Claude Code:claude-opus-5-5
* Read type.__module__ from the dict only for heap types
A static type's `__module__` is the text before the last `.` of its name,
or `builtins`. A heap type reads its dict and raises `AttributeError`
when the entry is missing; `type` and `object` reprs ignore that error.
`type()` no longer stores `__module__ = None` when the caller's globals
have no `__name__`.
`#[pyexception(module = ...)]` now reaches the type name, and static
types that relied on a dict `__module__` (ast nodes, pyexpat, ssl,
_hashlib and _interpchannels errors, ExceptionGroup) carry their module.
Assisted-by: Grok:4.7
Assisted-by: Claude:claude-opus-5-5
* Expose more builtin attributes as member descriptors
`code.co_flags`, `co_nlocals`, `co_filename`, `super.__self__`,
`__self_class__`, `__thisclass__`, `traceback.tb_frame`, `tb_lasti`,
`type.__itemsize__` and `builtin_function_or_method.__module__` are now
`#[pymember]` fields instead of getsets. `super` keeps its three
references in atomic cells instead of a lock, `tb_lasti` is an `i32`,
`co_nlocals` is stored at construction, and the builtin function
`__module__` is a writable object cell.
Assisted-by: Grok:4.7
Assisted-by: Claude:claude-opus-5-5
* Expose stdlib attributes as member descriptors
Decompressor `eof`/`needs_input`/`unused_data` (bz2, lzma, zlib, plus
lzma `check`), `ContextVar.name`, `functools.partial` `func`/`args`/
`keywords`, socket `family`/`type`/`proto`, `select.kevent` fields,
`SemLock` `handle`/`kind`/`maxvalue`/`name`, `Pickler.bin`/`fast`,
`xmlparser.intern`, ElementTree `XMLParser.entity`/`target`,
`UCD.unidata_version`, `_ExceptHookArgs` fields, multibytecodec
`stream`, and `_io` `Buffered*.raw` and `TextIOWrapper`
`buffer`/`encoding`/`line_buffering`/`write_through` are now
`#[pymember]` fields instead of getsets.
Values that changed under a lock move to atomic cells on the payload.
New member kinds `Short`, `Long`, `String`, `UShort`, `ULong`,
`LongLong` and `ULongLong` access exactly the width of their C type.
Assisted-by: Grok:4.7
Assisted-by: Claude:claude-opus-5-5
* Match bare super and static type itemsize
`super.__new__(super)` leaves `__thisclass__`, `__self__` and
`__self_class__` empty, and a super with no type takes the
zero-argument path when bound.
Static types carry their `tp_itemsize` (`type`, `memoryview`, `code`,
`frame`, generators, `_sre` objects, `_ctypes` thunks), inherit it from
their direct base when they leave it at 0, and a variable-size base
rejects any nonempty `__slots__` and a weakref slot.
`_thread._ExceptHookArgs` is a struct sequence.
Assisted-by: Grok:4.7
Assisted-by: Claude:claude-opus-5-5
* Expose SimpleNamespace.__dict__, __basicsize__ and __flags__ as members
`SimpleNamespace.__dict__` addresses the instance dict cell the same way
`module.__dict__` does. `slots.basicsize` now holds the full
`tp_basicsize` (header plus payload), so `__basicsize__` reads it
directly. Type flags are one atomic word: `__abstractmethods__` and
`_abc` set their bits in it in place, the separate `abc_tpflags` word is
gone, and `__flags__` reads the word as an unsigned long member.
Assisted-by: Grok:4.7
Assisted-by: Claude:claude-opus-5-5