After some \begin{lstlisting} ... \end{lstlisting}, LaTeX adds some additional vertical space. How can I avoid that?

Thanks to Scott H for the reference. It didn't directly helped me but it pointed out that the problem was my redefinition of \parskip and \baselineskip.
I'm using this now and it mostly works:
\begin{lstlisting}[belowskip=-0.8 \baselineskip]
CyclotomicField(order).gen().coordinates_in_terms_of_powers()
\end{lstlisting}
\baselineskip directly in latex (use \linespread or a font size command) and \parskip can only be changed with some care.
– David Carlisle
Jun 11 '13 at 21:17
\medskipamount. See the listings documentation (section 2.7 Layout elements, p 15, under the heading Vertical space).
– Werner
Jul 11 '13 at 21:21
\begin{lstlisting}[belowskip=-1.5 \baselineskip] @ alper
– Raoul HATTERER
Jun 15 '20 at 23:50
aboveskip option which can be used to control space above the listing block.
– High Performance Rangsiman
Dec 30 '21 at 00:51