Skip to content

Instantly share code, notes, and snippets.

View arthuro555's full-sized avatar
🤔
THNK

Arthur Pacaud (arthuro555) arthuro555

🤔
THNK
View GitHub Profile
@arthuro555
arthuro555 / calc.py
Created November 7, 2021 01:25
Simple calculator in python
from dataclasses import dataclass
from typing import Callable
@dataclass
class Position:
"""
Represents a portion of a string.
Note that while it is not strictly required to have position information,
it is always something useful to have and trivial to implement in an AST.