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 serhiy.storchaka
Recipients Todd Dembrey, belopolsky, berker.peksag, jleedev, matrixise, ncoghlan, pitrou, rhettinger, serhiy.storchaka, torsten, vstinner
Date 2017-04-15.16:36:03
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1492274164.22.0.655135181474.issue11822@psf.upfronthosting.co.za>
In-reply-to
Content
The problem with the *depth* parameter is that it adds a burden of choosing the value for the end user. "Oh, there are more deeper code objects, I must increase the depth and rerun dis()!" I think in most cases when that parameter is specified it would be set to some large value like 999 because you don't want to set it too small. Compare for example with the usage of the attribute maxDiff in unittests.

The single depth parameter doesn't adds too much control. You can't enable disassembling functions and method bodies but disable disassembling comprehensions in functions. If you need more control, you  should use non-recursive dis() and manually walk the tree of code objects.

How much output adds unlimited recursion in comparison with the recursion limited by the first level?

As for supporting invalid bytecode, currently the dis module doesn't support it (see issue26694).
History
Date User Action Args
2017-04-15 16:36:04serhiy.storchakasetrecipients: + serhiy.storchaka, rhettinger, ncoghlan, belopolsky, pitrou, vstinner, torsten, berker.peksag, jleedev, matrixise, Todd Dembrey
2017-04-15 16:36:04serhiy.storchakasetmessageid: <1492274164.22.0.655135181474.issue11822@psf.upfronthosting.co.za>
2017-04-15 16:36:04serhiy.storchakalinkissue11822 messages
2017-04-15 16:36:03serhiy.storchakacreate