From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1586 invoked by alias); 12 Jan 2012 16:52:21 -0000 Received: (qmail 1568 invoked by uid 22791); 12 Jan 2012 16:52:19 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from ausxippc101.us.dell.com (HELO ausxippc101.us.dell.com) (143.166.85.207) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 12 Jan 2012 16:52:06 +0000 X-Loopcount0: from 10.170.28.40 From: To: , CC: Date: Thu, 12 Jan 2012 16:55:00 -0000 Subject: RE: Make the "python" command resemble the standard Python interpreter Message-ID: <09787EF419216C41A903FD14EE5506DD030F1EB39B@AUSX7MCPC103.AMER.DELL.COM> References: In-Reply-To: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2012-01/txt/msg00410.txt.bz2 >There already is an established behaviour for python without arguments (wi= th or without a terminal). > >(gdb) python > > print 1 + 2 > > end >3 >(gdb) > >I've read the thread and I don't seen anyone raising this issue (could hav= e missed it though. I saw Tom's message re: what output CLI will generate,= but this is about behaviour). >I've read the patch and I don't think using from_tty is ok to select betwe= en the different behaviours. > >Can we pick a different way of invoking the python interpreter? But "python" seems rather an intuitive way of doing it. The existing behav= ior is quite surprising and unintuitive, because it accumulates an entire m= ulti-line string without any parsing, and then hands it off all at once to = Python. I see no reason to preserve that behavior if we have a normal Pyth= on interactive interpreter loop. That loop does everything the existing th= ing does and far more/better, so it should replace the old behavior. For example, if you commit a syntax error, the existing machinery doesn't t= ell you until much later, when you say "end". The interactive interpreter = will tell you at the time you make the error. paul