On 05/06/2024 13:19, Juraj Linkeš wrote:
+ return cls.compose(partial(int, base=int_base),
cls.find(pattern))
+
+ """ END PARSER FUNCTIONS """
+
+ @classmethod
+ def parse(cls, text: str) -> Self:
Would converting this into __init__(self, text: str) work
+
+ """ BEGIN PARSER FUNCTIONS """
+
+ @staticmethod
+ def compose(f: Callable, parser_fn: ParserFn) -> ParserFn:
+ """Makes a composite parser function.
+
+ The parser function is run and if a non-None value was
returned, f is called with it.
On 04/06/2024 16:13, Juraj Linkeš wrote:
I'd like to see a high level explanation of what the key pieces of the
parsing are and how they're tied to the implementation:
1. The text we're about to parse, passed to the instance of a subclass
2. What we're parsing, the fields of the subclass
3. How
There are mostly documentation and basically inconsequential minor comments.
On 9. 5. 2024 13:26, Luca Vizzarro wrote:
Adds parsing text into a custom dataclass. It provides a new
`TextParser` dataclass to be inherited. This implements the `parse`
method, which combined with the parser functions
On Thu, May 9, 2024 at 7:26 AM Luca Vizzarro wrote:
>
> Adds parsing text into a custom dataclass. It provides a new
> `TextParser` dataclass to be inherited. This implements the `parse`
> method, which combined with the parser functions, it can automatically
> parse the value for each field.
>
>
Adds parsing text into a custom dataclass. It provides a new
`TextParser` dataclass to be inherited. This implements the `parse`
method, which combined with the parser functions, it can automatically
parse the value for each field.
This new utility will facilitate and simplify the parsing of compl
6 matches
Mail list logo