Skip to content

Conversation

@msullivan
Copy link
Member

@msullivan msullivan commented Sep 29, 2025

I ran into a few things here:

  • The object.pyx code to handle decoding to subclasses only looks
    at __subclasses__, and so misses grandchildren types. I clearly
    remember thinking about this and testing the grandchild case,
    but apparently I missed something there.
  • Descendants of std::Object in particular get immediately screwy,
    because user-facing types don't inherit from std::Object directly,
    but instead their __shapes__ do.
  • The new "tname__ in __shapes__" mechanism (Move tname__ to base_shapes to reduce noise in interface classes. #926) was putting
    wrong stuff in the map in some cases.

My approach is to explicitly indicate which classes should be
considered the canonical decoding classes with a __gel_is_canonical__ = True field on the class. And for now, I'm populating it explicitly,
though we can probably write a bunch of nasty logic to figure it out too.

…ular

I ran into a few things here:
 - The object.pyx code to handle decoding to subclasses only looks
   at __subclasses__, and so misses grandchildren types. I clearly
   remember thinking about this and testing the grandchild case,
   but apparently I missed something there.
 - Descendants of std::Object in particular get immediately screwy,
   because user-facing types don't inherit from std::Object directly,
   but instead their __shapes__ do.
 - The new "`tname__` in `__shapes__`" mechanism (#926) was putting
   wrong stuff in the map in some cases.

My approach is to explicitly indicate which classes should be
considered the canonical decoding classes with a `__gel_is_canonical__
= True` field on the class. And for now, I'm populating it explicitly,
though we can probably write a bunch of nasty logic to figure it out too.
@msullivan msullivan merged commit 8a4d5aa into master Sep 30, 2025
84 of 85 checks passed
@msullivan msullivan deleted the link-deser branch September 30, 2025 01:46
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.

3 participants