Pyo3: Opt-out of `PyCell`

Created on 26 Jul 2020  路  2Comments  路  Source: PyO3/pyo3

Like we have #[pyclass(unsendable)] to opt-out of Send, many users will not want their pyclass to be mutable. It would be nice if we could allow them to opt-out of having PyCell as the backend, so that they don't have to deal with the performance cost.

needs-design performance

Most helpful comment

Could we couch this in terms of exclusive and non-exclusive access rather than mutability?

All 2 comments

Perhaps this opt-out could be #[pyclass(immutable)] ?

Though TBH I think I prefer immutable-by-default, so perhaps we should have #[pyclass(mutable)] to opt-in to PyCell!

Could we couch this in terms of exclusive and non-exclusive access rather than mutability?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jothan picture jothan  路  3Comments

konstin picture konstin  路  5Comments

inv2004 picture inv2004  路  4Comments

acminor picture acminor  路  3Comments

ametisf picture ametisf  路  3Comments