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

Expand the build_prefab function #11

Merged
merged 7 commits into from
May 15, 2024
Merged

Expand the build_prefab function #11

merged 7 commits into from
May 15, 2024

Conversation

DavidCEllis
Copy link
Owner

build_prefab now skips the gathering stage of @prefab as the values are provided, it will still set __annotations__ as expected.

It also now has a slots argument which can be used to create classes that use slots. This argument will not exist in the standard prefab(...) call as slots support is provided by declaring the class using __slots__ = SlotFields(...) rather than by an argument to prefab.

As an internal change there is now a GatheredFields class in the core which is used to provide to builder a callable that returns previously gathered fields and modifications. This is now used to add the additional methods to Field and GatheredFields itself.

@DavidCEllis DavidCEllis merged commit dd4103e into main May 15, 2024
7 checks passed
@DavidCEllis DavidCEllis deleted the expand_build_prefab branch May 15, 2024 11:10
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