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 vajrasky
Recipients Marc.Abramowitz, alex, barry, belopolsky, ezio.melotti, ncoghlan, nikratio, pitrou, python-dev, rhettinger, vajrasky, vstinner
Date 2013-10-10.08:44:00
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1381394640.57.0.243158062383.issue15805@psf.upfronthosting.co.za>
In-reply-to
Content
Nice.

My only complain is the dis.dis example. We don't have to use redirect_stdout context manager.

+        # How to capture disassembly to a string
+
+        import dis
+        import io
+
+        f = io.StringIO()
+        with redirect_stdout(f):
+            dis.dis('x**2 - y**2')
+        s = f.getvalue()


dis.dis supports file object natively. We can do this instead:
dis.dis('x**2 - y**2', file=f)
History
Date User Action Args
2013-10-10 08:44:00vajraskysetrecipients: + vajrasky, barry, rhettinger, ncoghlan, belopolsky, pitrou, vstinner, ezio.melotti, alex, nikratio, python-dev, Marc.Abramowitz
2013-10-10 08:44:00vajraskysetmessageid: <1381394640.57.0.243158062383.issue15805@psf.upfronthosting.co.za>
2013-10-10 08:44:00vajraskylinkissue15805 messages
2013-10-10 08:44:00vajraskycreate