Skip to content

Instantly share code, notes, and snippets.

import logging
import timeit
logger = logging.getLogger(__name__)
logging.basicConfig(filename='example.log', encoding='utf-8', level=logging.INFO)
def as_args():
some_str = "This is some kind of error message reasonably long"
@roganjoshp
roganjoshp / validation_demo.py
Last active October 18, 2025 07:05
Data Validation
# SETUP IN utils.py
class NumParse(Enum):
VAL = 1 # Valid number
INV = 2 # Invalid number format
NEG = 3 # Negative value
ZER = 4 # Zero value
EXC = 5 # Exceeds maximum value defined in config
def __eq__(self, other: str):