You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(protocols): Schema display and iteration follow PyPy's attribute layout, not the declared fields #2008
Schema takes the field order for __str__, __repr__ and __iter__ from the instance's __dict__. On PyPy, an instance's attributes follow the layout of an earlier instance of the same class, so a later schema can display or iterate its fields out of declared order. Packed bytes are unaffected: packing follows the declared fields.
This is the same cause as #2003, which fixed it for Info by recording the order at construction. Found while working on #2003.
Fix: derive the display and iteration order from the declared fields, not from __dict__. Add a test that reorders an instance's __dict__ on CPython to simulate PyPy.
Activity
JarryShaw commentedon Oct 20, 2026
Closing as not planned. Per your note on #2009, attribute order isn't required, and a check found nothing that depends on it in
Schema:pack,unpackand__bytes__walk the declared fields and read values by key;to_dictkeeps the same keys and values;On PyPy, only display and iteration order change.