Skip to content

TypeError: can't pickle _abc_data objects when a class made with pyfields inherits from an ABC #84

Closed

Description

@smarie

This happens when @autoclass or @autofields is used with a default value.

It seems that the _abc_data object from the ABC is mistakenly set as a field.

Activity

  1. added
    bug
    on Jun 21, 2021
  2. smarie commented on Jun 21, 2021

    @smarie
    OwnerAuthor

    There are two things we can do:

    • add an exclude arg to exclude auto-fields by name
    • add a check with deepcopy(value) at class creation time and raise an error if this does not work.
  3. smarie commented on Jun 21, 2021

    @smarie
    OwnerAuthor

    This only happens in python 3.7+ by the way

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions