Re: [libvirt] [PATCH] check-symfile: Use pythonesque string formatting instead of perl

2019-11-28 Thread Bjoern Walk
Michal Privoznik [2019-11-26, 09:48AM +0100]: > That's exactly what I find horrible. Just consider the following example: > > print(f'a={f(x,n):d}, b={g(x,n):d}') > > IMO the following is more readable: > > print("a=%d, b=%d" % (f(x,n), g(x,n))) First of all, the format specifiers (i.e, ":

Re: [libvirt] [PATCH] check-symfile: Use pythonesque string formatting instead of perl

2019-11-28 Thread Ján Tomko
On Thu, Nov 28, 2019 at 11:43:01AM +0100, Martin Kletzander wrote: The advantage of "".format() is that you cannot make one mistake that can happen with the currently used version and that is that sometimes you might need to make sure the variable is in a tuple, i.e. difference between `params` a

Re: [libvirt] [PATCH] check-symfile: Use pythonesque string formatting instead of perl

2019-11-28 Thread Martin Kletzander
On Tue, Nov 26, 2019 at 10:29:14AM +, Daniel P. Berrangé wrote: On Tue, Nov 26, 2019 at 11:25:28AM +0100, Pavel Hrdina wrote: On Tue, Nov 26, 2019 at 10:01:11AM +, Daniel P. Berrangé wrote: > On Tue, Nov 26, 2019 at 09:48:31AM +0100, Michal Privoznik wrote: > > On 11/26/19 9:24 AM, Erik

Re: [libvirt] [PATCH] check-symfile: Use pythonesque string formatting instead of perl

2019-11-26 Thread Daniel P . Berrangé
On Tue, Nov 26, 2019 at 11:25:28AM +0100, Pavel Hrdina wrote: > On Tue, Nov 26, 2019 at 10:01:11AM +, Daniel P. Berrangé wrote: > > On Tue, Nov 26, 2019 at 09:48:31AM +0100, Michal Privoznik wrote: > > > On 11/26/19 9:24 AM, Erik Skultety wrote: > > > > On Mon, Nov 25, 2019 at 05:17:54PM +0100,

Re: [libvirt] [PATCH] check-symfile: Use pythonesque string formatting instead of perl

2019-11-26 Thread Pavel Hrdina
On Tue, Nov 26, 2019 at 10:01:11AM +, Daniel P. Berrangé wrote: > On Tue, Nov 26, 2019 at 09:48:31AM +0100, Michal Privoznik wrote: > > On 11/26/19 9:24 AM, Erik Skultety wrote: > > > On Mon, Nov 25, 2019 at 05:17:54PM +0100, Michal Privoznik wrote: > > > > On 11/25/19 4:58 PM, Erik Skultety wr

Re: [libvirt] [PATCH] check-symfile: Use pythonesque string formatting instead of perl

2019-11-26 Thread Daniel P . Berrangé
On Tue, Nov 26, 2019 at 09:48:31AM +0100, Michal Privoznik wrote: > On 11/26/19 9:24 AM, Erik Skultety wrote: > > On Mon, Nov 25, 2019 at 05:17:54PM +0100, Michal Privoznik wrote: > > > On 11/25/19 4:58 PM, Erik Skultety wrote: > > > > On Mon, Nov 25, 2019 at 04:37:36PM +0100, Peter Krempa wrote: >

Re: [libvirt] [PATCH] check-symfile: Use pythonesque string formatting instead of perl

2019-11-26 Thread Ján Tomko
On Tue, Nov 26, 2019 at 09:51:18AM +0100, Fabiano Fidêncio wrote: On Mon, Nov 25, 2019 at 4:41 PM Peter Krempa wrote: Commit d30a1ad0443 translated the symbol file checker from perl to python by doing a literal translation in most cases. Unfortunately one string formatting operation was not re

Re: [libvirt] [PATCH] check-symfile: Use pythonesque string formatting instead of perl

2019-11-26 Thread Peter Krempa
On Mon, Nov 25, 2019 at 16:58:39 +0100, Erik Skultety wrote: > On Mon, Nov 25, 2019 at 04:37:36PM +0100, Peter Krempa wrote: > > Commit d30a1ad0443 translated the symbol file checker from perl to > > python by doing a literal translation in most cases. Unfortunately one > > string formatting operat

Re: [libvirt] [PATCH] check-symfile: Use pythonesque string formatting instead of perl

2019-11-26 Thread Fabiano Fidêncio
On Mon, Nov 25, 2019 at 4:41 PM Peter Krempa wrote: > > Commit d30a1ad0443 translated the symbol file checker from perl to > python by doing a literal translation in most cases. Unfortunately one > string formatting operation was not really translated into python > leaving users with non-helpful e

Re: [libvirt] [PATCH] check-symfile: Use pythonesque string formatting instead of perl

2019-11-26 Thread Michal Privoznik
On 11/26/19 9:24 AM, Erik Skultety wrote: On Mon, Nov 25, 2019 at 05:17:54PM +0100, Michal Privoznik wrote: On 11/25/19 4:58 PM, Erik Skultety wrote: On Mon, Nov 25, 2019 at 04:37:36PM +0100, Peter Krempa wrote: Commit d30a1ad0443 translated the symbol file checker from perl to python by doing

Re: [libvirt] [PATCH] check-symfile: Use pythonesque string formatting instead of perl

2019-11-26 Thread Erik Skultety
On Mon, Nov 25, 2019 at 05:17:54PM +0100, Michal Privoznik wrote: > On 11/25/19 4:58 PM, Erik Skultety wrote: > > On Mon, Nov 25, 2019 at 04:37:36PM +0100, Peter Krempa wrote: > > > Commit d30a1ad0443 translated the symbol file checker from perl to > > > python by doing a literal translation in mos

Re: [libvirt] [PATCH] check-symfile: Use pythonesque string formatting instead of perl

2019-11-25 Thread Michal Privoznik
On 11/25/19 4:58 PM, Erik Skultety wrote: On Mon, Nov 25, 2019 at 04:37:36PM +0100, Peter Krempa wrote: Commit d30a1ad0443 translated the symbol file checker from perl to python by doing a literal translation in most cases. Unfortunately one string formatting operation was not really translated

Re: [libvirt] [PATCH] check-symfile: Use pythonesque string formatting instead of perl

2019-11-25 Thread Erik Skultety
On Mon, Nov 25, 2019 at 04:37:36PM +0100, Peter Krempa wrote: > Commit d30a1ad0443 translated the symbol file checker from perl to > python by doing a literal translation in most cases. Unfortunately one > string formatting operation was not really translated into python > leaving users with non-he

Re: [libvirt] [PATCH] check-symfile: Use pythonesque string formatting instead of perl

2019-11-25 Thread Michal Privoznik
On 11/25/19 4:37 PM, Peter Krempa wrote: Commit d30a1ad0443 translated the symbol file checker from perl to python by doing a literal translation in most cases. Unfortunately one string formatting operation was not really translated into python leaving users with non-helpful error: 'Symbol $1 is

[libvirt] [PATCH] check-symfile: Use pythonesque string formatting instead of perl

2019-11-25 Thread Peter Krempa
Commit d30a1ad0443 translated the symbol file checker from perl to python by doing a literal translation in most cases. Unfortunately one string formatting operation was not really translated into python leaving users with non-helpful error: 'Symbol $1 is listed twice' Signed-off-by: Peter Krempa