[issue45546] Unable to pickle enum with nested frozen dataclass?

2021-11-03 Thread Ethan Furman
Change by Ethan Furman : -- Removed message: https://bugs.python.org/msg405650 ___ Python tracker ___ ___ Python-bugs-list mailing

[issue45546] Unable to pickle enum with nested frozen dataclass?

2021-11-03 Thread Ethan Furman
Ethan Furman added the comment: Eric, I'm already aware of the nested class issue; what I was hoping for was your actual use-case? You're pickling and sending an entire enum (and all its members) to another system/process? -- ___ Python tracker

[issue45546] Unable to pickle enum with nested frozen dataclass?

2021-10-21 Thread Eric Cousineau
Eric Cousineau added the comment: > 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

[issue45546] Unable to pickle enum with nested frozen dataclass?

2021-10-20 Thread Ethan Furman
Ethan Furman added the comment: I'm confused -- your initial report talks about pickling fields, but your tests are pickling the entire class... what am I missing? -- ___ Python tracker

[issue45546] Unable to pickle enum with nested frozen dataclass?

2021-10-20 Thread Eric V. Smith
Change by Eric V. Smith : -- nosy: +ethan.furman ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue45546] Unable to pickle enum with nested frozen dataclass?

2021-10-20 Thread Eric V. Smith
Eric V. Smith added the comment: I get an error with 3.8.10, but not on the main branch (3.11). I don't have other versions handy to test. Removing 3.6, as it's no longer getting bug fixes, and this doesn't look like a security issue. -- nosy: +eric.smith versions: -Python 3.6

[issue45546] Unable to pickle enum with nested frozen dataclass?

2021-10-20 Thread Eric Cousineau
Eric Cousineau added the comment: Thinking on it some more, I the current `Enum` metaclass doesn't distinguish between nested class and normal field, so it wraps it, thus why `pickle` gets confused. Perhaps it's possible to recognize this case - the class w/ `__qualname__` can be checked

[issue45546] Unable to pickle enum with nested frozen dataclass?

2021-10-20 Thread Eric Cousineau
Eric Cousineau added the comment: Ah, forgot to include error message: ``` E ... _pickle.PicklingError: Can't pickle : it's not the same object as __main__.DoesNotWork.NestedValue2 ``` -- ___ Python tracker

[issue45546] Unable to pickle enum with nested frozen dataclass?

2021-10-20 Thread Eric Cousineau
New submission from Eric Cousineau : I seem cannot pickle enum values from an enum class w/ a nested frozen dataclass. I can pickle a field from a normal class w/ a nested frozen dataclass, and I can pickle a field from an enum with a top-level frozen dataclass - perhaps it's some interplay