[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#70609: 30.0.50; [PATCH] New function 'python-shell-send-block' for p
From: |
kobarity |
Subject: |
bug#70609: 30.0.50; [PATCH] New function 'python-shell-send-block' for python-mode |
Date: |
Wed, 01 May 2024 17:15:23 +0900 |
User-agent: |
Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (Gojō) APEL-LB/10.8 EasyPG/1.0.0 Emacs/30.0.50 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) |
Lin Sun wrote:
> Hi Kobarity,
>
> On Tue, Apr 30, 2024 at 7:28 AM kobarity <kobarity@gmail.com> wrote:
> >
> > Eli Zaretskii wrote:
> > >
> > > > From: Lin Sun <sunlin7.mail@gmail.com>
> > > > Date: Sat, 27 Apr 2024 14:14:06 +0000
> > > >
> > > > Here is a function 'python-shell-send-block' to send a block to the
> > > > python interpreter in python mode, it's similar to
> > > > `python-shell-send-defun` but works on block.
> > > >
> > > > The implementation and testing are included in that patch.
> > > >
> > > > Please help review the changes.
> > > >
> > > > [PATCH] New function 'python-shell-send-block' for python-mode
> > > >
> > > > * lisp/progmodes/python.el: Add implemention of the function.
> > > > * test/lisp/progmodes/python-tests.el: Test case for the function.
> > > > * etc/NEWS: Document for the function.
> > >
> > > kobarity, any comments?
> >
> > I think `python-shell-send-block' itself is good, but there may be
> > room for improvement in the test case.
> >
> > It is better not to use f-strings as much as possible because it
> > depends on the Python version.
> >
> > `python-tests-look-at' is basically for moving point. Since it looks
> > for the next occurrence of the specified string, it may move the point
> > to an unexpected location. For testing, it would be better to use
> > `looking-at', etc. or compare the point after moving with
> > `python-tests-look-at' to the expected value.
> Thanks for the comments and you're right, so I attach the changes to
> avoid the python f-string, also using the `looking-at` to do exactly
> matching.
> Please help review the enhanced testing code. Thanks.
Hi Lin,
Thanks, it looks good to me.
- bug#70609: 30.0.50; [PATCH] New function 'python-shell-send-block' for python-mode,
kobarity <=