Skip to content

Refactor State creation logic#20691

Merged
ilevkivskyi merged 1 commit intopython:masterfrom
ilevkivskyi:state-factory
Jan 29, 2026
Merged

Refactor State creation logic#20691
ilevkivskyi merged 1 commit intopython:masterfrom
ilevkivskyi:state-factory

Conversation

@ilevkivskyi
Copy link
Copy Markdown
Member

Ref #933

This should be a pure refactoring unless i messed something up. This is needed to prepare to make State serializeable, so that we can send graph over the network to build workers (which is required for parallel parsing). Also not having tons of custom logic in __init__() is a better style anyway.

Note I make the new state factory a classmethod to minimize the diff. If there is a preference, I can make it a regular function.

@github-actions
Copy link
Copy Markdown
Contributor

According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅

@ilevkivskyi ilevkivskyi merged commit ba3e064 into python:master Jan 29, 2026
23 checks passed
@ilevkivskyi ilevkivskyi deleted the state-factory branch January 29, 2026 22:54
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.

2 participants