Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Opt-out of PyCell #1068

Open
davidhewitt opened this issue Jul 26, 2020 · 3 comments
Open

Opt-out of PyCell #1068

davidhewitt opened this issue Jul 26, 2020 · 3 comments

Comments

@davidhewitt
Copy link
Member

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.

@davidhewitt
Copy link
Member Author

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!

@gilescope
Copy link
Contributor

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

@davidhewitt
Copy link
Member Author

First step of this in #1979 has now been merged. A future refinement will be to make mutability (and accompanying overhead) opt-in.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants