Skip to content

Conversation

@tamarinvs19
Copy link
Collaborator

Description

Supported serialisation and deserialsation of python objects that have custom states (e.g. have __slots__ with a list of valid attributes). For these objects we should use __reduce_ex__ method instead of __reduce__ to serialise if it is possible and then use custom method __setstate__ to deserialise state.

Changes in utbot-executor: tamarinvs19/utbot_executor#1

How to test

Automated tests

There are tests for serialization and deserialization processes in utbot-executor (utbot_executor/deep_serialization/tests.py)

Manual tests

See example utbot-python/samples/easy_samples/setstate_test.py

Expected: success test generation for make_my_class

Self-check list

Check off the item if the statement is true. Hint: [x] is a marked item.

Please do not delete the list or its items.

  • I've set the proper labels for my PR (at least, for category and component).
  • PR title and description are clear and intelligible.
  • I've added enough comments to my code, particularly in hard-to-understand areas.
  • The functionality I've repaired, changed or added is covered with automated tests.
  • Manual tests have been provided optionally.
  • The documentation for the functionality I've been working on is up-to-date.

@tamarinvs19 tamarinvs19 added ctg-enhancement New feature, improvement or change request lang-python Issue is related to python support labels Jun 20, 2023
@tamarinvs19 tamarinvs19 self-assigned this Jun 20, 2023
@tamarinvs19 tamarinvs19 requested a review from tochilinak June 21, 2023 11:50
@tamarinvs19 tamarinvs19 merged commit 4eee309 into main Jun 26, 2023
@tamarinvs19 tamarinvs19 deleted the tamarinvs19/support_setstate branch June 26, 2023 06:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ctg-enhancement New feature, improvement or change request lang-python Issue is related to python support

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants