Skip to content

Conversation

encukou
Copy link
Member

@encukou encukou commented Sep 20, 2024

  • If setting _fields_ fails, e.g. with AttributeError, don't set the attribute in __dict__
  • Document the “finalization” behaviour
  • Beef up tests: add getattr, test Union as well as Structure
  • Put common functionality in a common function

P.S. del X._fields_ is still allowed; preventing that is out of scope of this change. Like mutating the list, it doesn't have an effect. (_fields_ is read once, when the class is finalized, and not consulted again.)


📚 Documentation preview 📚: https://cpython-previews--124292.org.readthedocs.build/

Co-authored-by: Peter Bierma <[email protected]>
@encukou encukou merged commit be76e3f into python:main Sep 24, 2024
37 checks passed
@encukou encukou deleted the gh-100980 branch September 24, 2024 00:40
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