bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] gnulib-tool.py: Handle removed files in the vc ignore files.


From: Collin Funk
Subject: Re: [PATCH] gnulib-tool.py: Handle removed files in the vc ignore files.
Date: Mon, 25 Mar 2024 15:18:15 -0700
User-agent: Mozilla Thunderbird

Hi Bruno,

On 3/25/24 5:00 AM, Bruno Haible wrote:
> - Your ability to work with misnamed variables is amazing. But
>   nonetheless let's make an effort to find better names :)

LOL, I appreciate the compliment, but yes I agree better naming is good.

> - Python has enough string processing primitives that we don't need
>   to write conditional expressions like
>     line if not line.endswith('\n') else line[:-1]
> 
>   (I also tried to move the removal of the newlines into the readlines()
>   invocation, but that does not work:
>   https://github.com/python/cpython/issues/52876 )

Usually I use str.[lr]strip() with no parameters which just cleans all
the whitespace. I completely forgot you could just do
line.rstrip('\n') there... Sorry about that.

I also tried to remove the newlines in readlines(), but I couldn't
figure it out... Hopefully that issue will get resolved because I feel
like there should be some way to do it automatically.

Collin



reply via email to

[Prev in Thread] Current Thread [Next in Thread]