I took a couple of hours to rewrite my reader with , style that is:

— no dependency;
— named tuple;
— try to use match;

The experience is not without interest; I know the limits of python's match as far as 3.10 goes, and generally know better the advantage of the approach described above as *hyper* style.

I also have a better picture of the reader algorithm I want.

It includes 7 tests, and its own test runner!

Scan the code at

Reply a TIL :)

· · Web · 1 · 1 · 0

@amirouche Could'nt

while offset != len(string):
char = string[offset]

Be written as:

for offset, char in enumearte(string):


Sign in to participate in the conversation

The social network of the future: No ads, no corporate surveillance, ethical design, and decentralization! Own your data with Mastodon!