[Patches] [ python-Patches-683074 ] Optional output streams for dis

SourceForge.net noreply@sourceforge.net
Thu, 22 May 2003 10:53:54 -0700


Patches item #683074, was opened at 2003-02-08 14:22
Message generated for change (Comment added) made by logistix
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=683074&group_id=5470

Category: Library (Lib)
Group: None
Status: Closed
Resolution: Rejected
Priority: 5
Submitted By: logistix (logistix)
Assigned to: Raymond Hettinger (rhettinger)
Summary: Optional output streams for dis

Initial Comment:
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.



----------------------------------------------------------------------

>Comment By: logistix (logistix)
Date: 2003-05-22 12:53

Message:
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.

----------------------------------------------------------------------

Comment By: Tim Peters (tim_one)
Date: 2003-05-22 11:34

Message:
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>.

----------------------------------------------------------------------

Comment By: Raymond Hettinger (rhettinger)
Date: 2003-05-22 11:30

Message:
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?

----------------------------------------------------------------------

Comment By: Tim Peters (tim_one)
Date: 2003-05-22 09:21

Message:
Logged In: YES 
user_id=31435

OK, closing this.

----------------------------------------------------------------------

Comment By: logistix (logistix)
Date: 2003-05-22 08:09

Message:
Logged In: YES 
user_id=699438

Raymond,

This actually got a thumbs down on python-dev.  You can just 
close it out.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=683074&group_id=5470