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.

classification
Title: Optional output streams for dis
Type: Stage:
Components: Library (Lib) Versions:
process
Status: closed Resolution: rejected
Dependencies: Superseder:
Assigned To: rhettinger Nosy List: logistix, rhettinger, tim.peters
Priority: normal Keywords: patch

Created on 2003-02-08 20:22 by logistix, last changed 2022-04-10 16:06 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
dis.diff logistix, 2003-02-08 20:23
Messages (6)
msg42725 - (view) Author: Grant Olson (logistix) Date: 2003-02-08 20:22
Right now the dis module uses print to output.  This 
restricts it's use to interactive.  You can't easily route 
the output to files, webpages, run re's on it, etc.

This patch just adds an optional keyword parameter 
write that defaults to sys.stdout.write and replaces print 
statments with calls to write.

msg42726 - (view) Author: Grant Olson (logistix) Date: 2003-05-22 13:09
Logged In: YES 
user_id=699438

Raymond,

This actually got a thumbs down on python-dev.  You can just 
close it out.
msg42727 - (view) Author: Tim Peters (tim.peters) * (Python committer) Date: 2003-05-22 14:21
Logged In: YES 
user_id=31435

OK, closing this.
msg42728 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2003-05-22 16:30
Logged In: YES 
user_id=80475

Tim, there is a similar patch for pdb.py
at www.python.org/sf/721464.

Like Anthony's patch to cmd.py, I think
it has a valid use case and should go in.

Knowing why cmd.py was accepted and
why dis.py was rejected, what do you think
about pdb.py?
msg42729 - (view) Author: Tim Peters (tim.peters) * (Python committer) Date: 2003-05-22 16:34
Logged In: YES 
user_id=31435

Sorry, I don't have an opinion about pdb -- I've hardly ever 
used it.  Do what you think is best, and Guido will hit you if 
he disagrees <wink>.
msg42730 - (view) Author: Grant Olson (logistix) Date: 2003-05-22 17:53
Logged In: YES 
user_id=699438

Basically, Guido was -1 saying you can redirect sys.stdout 
and no one else cared one way or the other.  So it wasn't an 
outright rejection, more lack of interest.

In my particular case, I was routing the output to a webserver, 
and was concerned about the thread safety of temporarily 
redirecting sys.stdout to a socket.

After I sumbitted, I also realized I missed passing the write 
parameter into one of the calls.  It should be easy to find but 
if you want a good patch let me know.
History
Date User Action Args
2022-04-10 16:06:38adminsetgithub: 37940
2003-02-08 20:22:51logistixcreate