Message404632
> I get an error with 3.8.10, but not on the main branch (3.11) [...]
Confirmed, using 3.11.0a1 (using Docker). Seems like at least the pickling is fixed?
> I'm confused -- your initial report talks about pickling fields, but your tests are pickling the entire class... what am I missing?
Sorry about that; the original file, `enum_test.py`, was just trying to pickle an enum field, i.e. `DoesNotWork.a`. However, because it uses the type `DoesNotWork.NestedValue2`, `pickle` tries to unpackage that type, but cannot access it via name because `DoesNotWork.NestedValue2` is wrapped as an enum *field*, rather than just a normal field.
I've uploaded a new file, `enum_nested_type_test.py`, that perhaps shows the root cause - the `Enum` interprets the nested class as an enum field (wrapping it as an enum value), rather than as "just" a nested class. In contrast, it did not seem to wrap the function.
Does that make sense / help at all? |
|
Date |
User |
Action |
Args |
2021-10-21 18:32:21 | Eric Cousineau | set | recipients:
+ Eric Cousineau, eric.smith, ethan.furman |
2021-10-21 18:32:21 | Eric Cousineau | set | messageid: <1634841141.1.0.422900220835.issue45546@roundup.psfhosted.org> |
2021-10-21 18:32:21 | Eric Cousineau | link | issue45546 messages |
2021-10-21 18:32:21 | Eric Cousineau | create | |
|