From: kobarity <kobarity@gmail.com>
To: Lin Sun <sunlin7.mail@gmail.com>
Cc: Eli Zaretskii <eliz@gnu.org>, 70609@debbugs.gnu.org
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 [thread overview]
Message-ID: <eke7ikzy0wys.wl-kobarity@gmail.com> (raw)
In-Reply-To: <CABCREdps5ROqY1zYHUak_c-RRUjFM4RGn3d-5oR3U5fdqasg8w@mail.gmail.com>
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.
next prev parent reply other threads:[~2024-05-01 8:15 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-27 14:14 bug#70609: 30.0.50; [PATCH] New function 'python-shell-send-block' for python-mode Lin Sun
2024-04-29 12:57 ` Eli Zaretskii
2024-04-30 7:28 ` kobarity
2024-04-30 15:51 ` Lin Sun
2024-05-01 8:15 ` kobarity [this message]
2024-05-02 10:05 ` Eli Zaretskii
2024-05-02 15:38 ` Lin Sun
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=eke7ikzy0wys.wl-kobarity@gmail.com \
--to=kobarity@gmail.com \
--cc=70609@debbugs.gnu.org \
--cc=eliz@gnu.org \
--cc=sunlin7.mail@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).