Skip to content

Rename internal constants from dunders, return MappingProxyType from functions - #122

Merged
DavidCEllis merged 5 commits into
mainfrom
rename-most-dunders
Jul 21, 2026
Merged

Rename internal constants from dunders, return MappingProxyType from functions#122
DavidCEllis merged 5 commits into
mainfrom
rename-most-dunders

Conversation

@DavidCEllis

Copy link
Copy Markdown
Owner
  • Internal details are renamed from __classbuilder_*__ to _classbuilder_*_ as dunder names are technically reserved for CPython

    • This doesn't change __prefab_post_init__ or similar values as those are defined by the user and as such this would break usage
  • get_fields, get_flags, get_methods and get_attributes now all return MappingProxyType. These are intended as views, the user should not mutate them but the original class still owns them.

…e reserved for

CPython.

This doesn't change the __prefab_pre_init__, __prefab_init__ or __prefab_post_init__
functions as they may be used or defined by users directly.
…s`. Make all of the

`get_x` functions return `MappingProxyType` to indicate they are not to be modified.
@DavidCEllis
DavidCEllis merged commit 855ad3c into main Jul 21, 2026
6 checks passed
@DavidCEllis
DavidCEllis deleted the rename-most-dunders branch July 30, 2026 11:12
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