Re: [PATCH 1/6] dts: add parameters data structure

2024-04-10 Thread Juraj Linkeš
On Wed, Apr 10, 2024 at 11:51 AM Luca Vizzarro wrote: > > On 10/04/2024 10:15, Juraj Linkeš wrote: > + > +def value_only(metadata: dict[str, Any] = {}) -> dict[str, Any]: > +"""Injects the value of the attribute as-is without flag. Metadata > modifier for :func:`dataclasse

Re: [PATCH 1/6] dts: add parameters data structure

2024-04-10 Thread Luca Vizzarro
On 10/04/2024 10:15, Juraj Linkeš wrote: + +def value_only(metadata: dict[str, Any] = {}) -> dict[str, Any]: +"""Injects the value of the attribute as-is without flag. Metadata modifier for :func:`dataclasses.field`.""" +return {**metadata, META_VALUE_ONLY: True} These methods, on the

Re: [PATCH 1/6] dts: add parameters data structure

2024-04-10 Thread Juraj Linkeš
On Tue, Apr 9, 2024 at 6:28 PM Luca Vizzarro wrote: > > Thank you so much for your review Juraj! > You're welcome! > >> + > >> +def value_only(metadata: dict[str, Any] = {}) -> dict[str, Any]: > >> +"""Injects the value of the attribute as-is without flag. Metadata > >> modifier for :func:`

Re: [PATCH 1/6] dts: add parameters data structure

2024-04-09 Thread Luca Vizzarro
Thank you so much for your review Juraj! On 09/04/2024 13:10, Juraj Linkeš wrote: We shouldn't list what the patch does, but rather explain the choices made within. It seems to me the patch is here to give devs an API instead of them having to construct strings - explaining why this approach imp

Re: [PATCH 1/6] dts: add parameters data structure

2024-04-09 Thread Luca Vizzarro
Thank you for your review Jeremy! On 28/03/2024 16:48, Jeremy Spewock wrote: I might add some kind of block comment here as a separator that delimits that metadata modifiers start here. Something like what is written in scapy.py which creates sections for XML-RPC method vs ones that are run by t

Re: [PATCH 1/6] dts: add parameters data structure

2024-04-09 Thread Juraj Linkeš
On Tue, Mar 26, 2024 at 8:04 PM Luca Vizzarro wrote: > > This commit introduces a new "params" module, which adds a new way > to manage command line parameters. The provided Params dataclass > is able to read the fields of its child class and produce a string > representation to supply to the comm

Re: [PATCH 1/6] dts: add parameters data structure

2024-03-28 Thread Jeremy Spewock
Overall I like the idea of having a structured way of passing command-line arguments to applications as strings and I think that this is a well-abstracted approach. I also like that this approach still supports the ability to pass strings "as-is" and use them as parameters as well. That opens the d

[PATCH 1/6] dts: add parameters data structure

2024-03-26 Thread Luca Vizzarro
This commit introduces a new "params" module, which adds a new way to manage command line parameters. The provided Params dataclass is able to read the fields of its child class and produce a string representation to supply to the command line. Any data structure that is intended to represent comma