Skip to content

Instantly share code, notes, and snippets.

View davidhewitt's full-sized avatar

David Hewitt davidhewitt

View GitHub Profile
@davidhewitt
davidhewitt / pyo3-arbitrary-self-types.rs
Last active October 25, 2023 13:08
Dreaming of arbitrary self types for PyO3
//! The following is a simplified form of a possible PyO3 API which shows
//! cases where arbitrary self types would help resolve papercuts.
// ----------------------------------------------------------------------------------
//
// Case 1 - PyO3's object hierarchy. We have a smart pointer type Py<T> and want to
// use it as a receiver for Python method calls.
//
//