[issue42360] In the namedtuple documentation, mention that typename should match the variable name for the class to be pickle-able

2020-11-15 Thread Alejandro Gonzalez
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

[issue28869] __module__ attribute is not set correctly for a class created by direct metaclass call

2019-07-22 Thread Alejandro Gonzalez
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

[issue28869] __module__ attribute is not set correctly for a class created by direct metaclass call

2019-07-20 Thread Alejandro Gonzalez
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

[issue28869] __module__ attribute is not set correctly for a class created by direct metaclass call

2019-06-17 Thread Alejandro Gonzalez
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 anytime the

[issue28869] __module__ attribute is not set correctly for a class created by direct metaclass call

2019-06-16 Thread Alejandro Gonzalez
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 work

[issue28869] __module__ attribute is not set correctly for a class created by direct metaclass call

2019-06-16 Thread Alejandro Gonzalez
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

[issue28869] __module__ attribute is not set correctly for a class created by direct metaclass call

2019-06-12 Thread Alejandro Gonzalez
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 >the

[issue28869] __module__ attribute is not set correctly for a class created by direct metaclass call

2019-06-09 Thread Alejandro Gonzalez
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, because