Open sohang3112 opened 7 months ago
Considering the existing PRs, it’s unlikely there will be any improvement to this code. As all benchmarks or similar measuring means, these are biased as well. There is a certain point that needs to be proven.
And you can’t really argue here because code verbosity and readability are very subjective, even having all the language style guides. It’s easy to dismiss almost any proposed revisions as not readable enough.
Can it be improved with data classes or named tuples? Yes. How about generators? Yes. Will it ever be made? I honestly doubt that. Maybe I’m mistaken.
(I came here from the original Twitter thread about Rust, which makes sense in many ways, but this example rubbed me the wrong way. Not to wage a war or have a beef, though. Simply passing by.)
The Python code can be improved & made more idiomatic.
For example, this class code:
is much better written as just:
Similarly for
Sexp
class.