Skip to content

Conversation

bblommers
Copy link
Contributor

Improves the serialization for more complex objects.

In it's current state, we correctly serialize simple attributes in an object:

class CustomObject:
    def __init__():
        self.attr1 = "a"
        self.attr2 = ["b", True]

This PR also adds support for:

  1. Properties (methods denoted with @property)
  2. Iterators (which are automatically iterated on, i.e. converted to a list)
  3. Enums (which now serialize the value itself, instead of whatever the result of str(enum) returns

Testing

I've tried this out with our own emulator and tried to convert various (complex) objects, and have encountered no problems.

Copy link

@bryansan-local bryansan-local left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Finalllyyyyyyy ahhhhhhh

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