[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <67ca4c5c91c2a_4cd7a29460@willemb.c.googlers.com.notmuch>
Date: Thu, 06 Mar 2025 20:31:08 -0500
From: Willem de Bruijn <willemdebruijn.kernel@...il.com>
To: Jakub Kicinski <kuba@...nel.org>,
Willem de Bruijn <willemb@...gle.com>
Cc: davem@...emloft.net,
netdev@...r.kernel.org,
edumazet@...gle.com,
pabeni@...hat.com,
andrew+netdev@...n.ch,
horms@...nel.org,
shuah@...nel.org,
petrm@...dia.com,
sdf@...ichev.me,
linux-kselftest@...r.kernel.org
Subject: Re: [PATCH net-next v2 1/2] selftests: drv-net: add path helper for
net/lib
Jakub Kicinski wrote:
> On Thu, 6 Mar 2025 17:22:47 -0500 Willem de Bruijn wrote:
> > > + def lpath(self, path):
> > > + """
> > > + Similar to rpath, but for files in net/lib TARGET.
> > > + """
> > > + lib_dir = (Path(__file__).parent / "../../../../net/lib").resolve()
> > > + return (lib_dir / path).as_posix()
> > > +
> >
> > small nit that one letter acronyms are not the most self describing ;)
> > I would initially read this as local path
>
> The other option that came to mind was to have one helper called path()
> and pass rel=CONST to it. For example:
>
> prog = cfg.path("xdp_dummy.bpf.o", rel=cfg.NET_LIB)
>
> Thinking about it now we could also store dir directly, which is
> probably most "Pythonic"?
>
> prog = cfg.net_lib_dir / "xdp_dummy.bpf.o"
>
> Thoughts?
The pythonic approach is nice. No function indirection, so self explanatory.
But they all are reasonable, of course.
Powered by blists - more mailing lists