New submission from Alejandro Gonzalez :
I think the namedtuple documentation should mention that, for classes created
with it to be pickle-able, the typename argument must match the name of the
variable the class is being assigned to. Otherwise you get an error like this
Alejandro Gonzalez added the comment:
I see, that’s an interesting point. In that case, Serhiy’s approach is indeed
better.
PR 14166 seems stalled. I’d like to help if there’s anything left to do, if
possible :)
--
___
Python tracker
<ht
Alejandro Gonzalez added the comment:
Hello,
Could anyone take a look at the PR 14126 submitted?
Sorry for the trouble and thank you in advance.
--
___
Python tracker
<https://bugs.python.org/issue28
Alejandro Gonzalez added the comment:
>It can be fixed in general if deduce __module__ in type.__call__() instead of
>type.__new__().
But wouldn't we have the same problem if a metaclass overrides type.__call__
instead?
Also, wouldn't that reset the __module__ value anyt
Alejandro Gonzalez added the comment:
>Getting the module name from the caller's frame is an expensive operation. It
>is safe to set __module__ to None. In such case the pickle module is able to
>find the proper module containing the definition of the class.
Wow, indeed it
Change by Alejandro Gonzalez :
--
keywords: +patch
pull_requests: +13973
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/14126
___
Python tracker
<https://bugs.python.org/issu
Alejandro Gonzalez added the comment:
>I think we can proceed with option A, but only if doesn't cause visible
>slow-down for creating ABCs (which is already slower that normal classes).
>TBH, I don't want to document A as "official" recipe (maybe however mention
Alejandro Gonzalez added the comment:
Hello, I would like to add further on this issue.
(I'm new to bpo. Please advise if this report could be better)
Issue
-
Pickling breaks when attempting to dump an instance of a class that was defined
by calling ABCMeta directly, becau