This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author pwil3058
Recipients daniel.urban, pwil3058, r.david.murray
Date 2011-07-02.00:26:24
SpamBayes Score 2.1853423e-07
Marked as misclassified No
Message-id <1309566384.96.0.748131316958.issue12457@psf.upfronthosting.co.za>
In-reply-to
Content
The class I was pickling was a top level class but a field inside that class had an instance of a nested class set as its value.  The error message produced indicated that the reason for failure was the inability of pickle to find the class definition and (I think) that was caused by the problem with type()'s returned value.

Perhaps fixing the problem with type() would allow the restriction on pickling nested classes to be removed?  Was that restriction a deliberate design decision (illogical) or the result of not being able to get it to work?

Re whether the behaviour of type() is a problem:  I believe it is as, in addition to the inconsistencies between type() and isinstance() that I described in my original report, there is the confusion that arises if two separate classes have nested classes with the same name (see mini program confusion.py as an example).  This seems to compromise the whole purpose of namespaces and is inconsistent with the way modules are treated in determining the name reported by type().
History
Date User Action Args
2011-07-02 00:26:25pwil3058setrecipients: + pwil3058, r.david.murray, daniel.urban
2011-07-02 00:26:24pwil3058setmessageid: <1309566384.96.0.748131316958.issue12457@psf.upfronthosting.co.za>
2011-07-02 00:26:24pwil3058linkissue12457 messages
2011-07-02 00:26:24pwil3058create