• Dean Moldovan's avatar
    Add py::reinterpret_borrow<T>()/steal<T>() for low-level unchecked casts · c7ac16bb
    Dean Moldovan authored
    The pytype converting constructors are convenient and safe for user
    code, but for library internals the additional type checks and possible
    conversions are sometimes not desired. `reinterpret_borrow<T>()` and
    `reinterpret_steal<T>()` serve as the low-level unsafe counterparts
    of `cast<T>()`.
    
    This deprecates the `object(handle, bool)` constructor.
    
    Renamed `borrowed` parameter to `is_borrowed` to avoid shadowing
    warnings on MSVC.
    c7ac16bb
eval.h 3.18 KB