Ma

Made a simple parser/evaluator of arithmetic expressions in Python

Hacker News

Made a simple parser/evaluator of arithmetic expressions in Python

I was noodling around with Python on a boring evening, when I decided to try my hand at writing a hand rolled arithmetic expression parser/evaluator without using any parsing tools/generators. I made this repo purely for educational/fun purpose since it only supports 4 basic arithmetic operators and nested sub-expressions (to make it slightly more challenging :P). Then I had the idea to extend the unit tests with Hypothesis (Python's property based unit testing library) and it found an edge case in my simple implementation that I thought had it covered via unit tests! Sharing this repo just in case anyone finds it interesting (esp. the hypothesis test file.)

Share card

Actual performance

1points
Did not reach leaderboard

Launch Intel predictions

Analyze your own launch →
Indie HackersFits the IH revenue-focused audience · Strong signals: supports · Missing: reddit linkedin, podcasting, created
67%67% predicted probability of success on Indie Hackers, based on ML models trained on real launch data.
best fitHighest predicted score across all platforms for this description.
AppSumoMay struggle as an AppSumo deal · Missing: plus, platform, intuitive
50%50% predicted probability of success on AppSumo, based on ML models trained on real launch data.
TrustMRRLess likely to generate early MRR · Strong signals: education · Missing: mobile apps, ios, personal
39%39% predicted probability of success on TrustMRR, based on ML models trained on real launch data.
Product HuntUnlikely to reach the leaderboard · Strong signals: using · Missing: mac, agents, macos
35%35% predicted probability of success on Product Hunt, based on ML models trained on real launch data.
Hacker NewsMay not resonate with HN audience · Strong signals: lua, ide, io · Missing: https docs, excited, just released
33%33% predicted probability of success on Hacker News, based on ML models trained on real launch data.
nativeThis product was originally launched on this platform.
Acquire.comPre-revenue stage for this audience · Missing: arr, mrr, revenue
16%16% predicted probability of success on Acquire.com, based on ML models trained on real launch data.
BetaListMay not resonate with beta-testers · Missing: web3, chat, crypto
2%2% predicted probability of success on BetaList, based on ML models trained on real launch data.

Correct prediction on native model

Similar products

A
A Pratt Parser in Python47%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

A Pratt Parser in Python

Hacker News5
Py
Python bindings to the Servo HTML5 parser, html5ever50%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Python bindings to the Servo HTML5 parser, html5ever

Hacker News146
Py
PyCParser, C parser and interpreter in Python54%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

PyCParser, C parser and interpreter in Python

Hacker News112
CN
CNC G and M Code Parser in Python60%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

CNC G and M Code Parser in Python

Hacker News2
La
Lark, an easy Earley parser for Python49%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Lark, an easy Earley parser for Python

Hacker News2
Ea
Easy parser combinators for python 349%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Easy parser combinators for python 3

Hacker News4
Cu
Custom String Parser ( Python)41%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Custom String Parser ( Python)

Hacker News3
JP
JParserCombinator – Simple parser combinator for Java33%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

JParserCombinator – Simple parser combinator for Java

Hacker News2
li
libpypa – A Python Parser Library in C++49%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

libpypa – A Python Parser Library in C++

Hacker News2
li
libpypa – A Python Parser Library in C++49%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

libpypa – A Python Parser Library in C++

Hacker News2