Skip to content

Conversation

ngoldbaum
Copy link

@ngoldbaum ngoldbaum commented Sep 5, 2025

The Regex and Token class are both immutable and can be trivially marked as frozen. The avoids the cost of atomic reference counting for any reads in Python on borrowed data.

It's likely that in the future frozen will become the default for pyclasses.

See #1860 (comment) and reply for more details.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant