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 ncoghlan
Recipients ncoghlan
Date 2017-08-14.06:39:44
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1502692785.51.0.58821810388.issue31197@psf.upfronthosting.co.za>
In-reply-to
Content
In reviewing the PR for issue 31183, I noticed that the criteria for deciding which values to disassemble when disassembling a namespace (objects with a __dict__ attribute) has gotten out of sync with the criteria used by the dis() itself.

The problem is that dis() checks for particular attributes that may contain code objects, while the recursive descent when processing a __dict__ attribute is based on isinstance() and a predefined list of types.

My proposed remedy for this would be:

1. Factor out a dis._get_code() helper function that returns either None or a compiled code object
2. Base the recursive descent in __dict__ processing on the value either having a __dict__ attribute, or else _get_code() returning a non-None result (in the latter case, the code object itself would be passed to the recursive call, rather than the original value from the namespace)
History
Date User Action Args
2017-08-14 06:39:45ncoghlansetrecipients: + ncoghlan
2017-08-14 06:39:45ncoghlansetmessageid: <1502692785.51.0.58821810388.issue31197@psf.upfronthosting.co.za>
2017-08-14 06:39:45ncoghlanlinkissue31197 messages
2017-08-14 06:39:44ncoghlancreate