Use Python docstrings as exception messages
The following exception @dataclass class PodBayDoorsStillClosed(DocumentedError): """ I’m sorry, {self.user_name}. I’m afraid I can’t do that. """ user_name: str when raised as raise PodBayDoorsStillClosed('Dave') will print PodBayDoorsStillClosed: I’m sorry, Dave. I’m afraid I can’t do that. Reduce the boilerplate, use more exception classes to better express the business logic, or invent your own use cases :) Can be tried out as: pip install documented which works for Python ⩾ 3.8.1.
Use Python docstrings as exception messages launched on October 6, 2023 with 7 votes, #1,559 of 4,393 launches that month and more than 50% of that year's launches. The site was still online in September 2026, 3 years on.
What it does
Templated docstrings for Python classes. Contribute to anatoly-scherbakov/documented development by creating an account on GitHub.
Does a similar job
all alternatives →
A Python package to get help from ChatGPT when an exception is thrown2022 · github.com · ▲37Contribute to fkhan0520/cgpt_exceptions development by creating an account on GitHub.
Debugging-Friendly Tracebacks for Python2019 · github.com · ▲123Debugging-friendly exceptions for Python. Contribute to cknd/stackprinter development by creating an account on GitHub.


A design-by-contract Python package in ~100 lines2022 · github.com · ▲58Greetings! A 2.5 weekends project to teach myself newer Python features (>= 3.10). Conditions are written as Lambda expressions that annotate parameters and return types, and coexist with type annotations. Symbols to share values between conditions are also supported to a limited extend.
PyScribe – A Python library to make print debugging more efficient2015 · github.com · ▲53DEPCRECATED/UNMAINTAINED - A Python library to make debugging with print statements simpler and more effective. - alixander/PyScribe
More dev tools this month
the category →

open-source IDE for thoughtful software design. Contribute to devdotfast/whiteboard development by creating an account on GitHub.
Dev tools · 27d ago · github.com

Contribute to reladraw/reladraw development by creating an account on GitHub.
Dev tools · 25d ago · github.com
OpenBot▲362Grok Bot alternative: free, local, open-source, multiplayer
Dev tools · 23d ago · openbot.run
Talanoa▲345Hi HN, I’m a fullstack developer, and honestly, I’ve lost count of how many side projects I’ve worked on over the years. But one idea kept coming back to me: a different kind of email client. It first came to me in 2014: “What if we could handle emails more like conversations?” Every year, I’d revisit this concept in my “Build Notes.” Ten years later, no one had built exactly what I had in mind — so I finally decided to do it myself. That’s how Talanoa was born. I wanted something focused on people, not timelines. I was tired of marking messages as unread just to remember to reply later, or…
Dev tools · 20d ago · talanoa.email
CoreSpeed▲332One MCP for everything your agents need: apps, memory, tools
Dev tools · 28d ago · corespeed.io
Source: Show HN post ↗
Launched alongside, October 2023
the whole month →
Nudge 2.0▲1,051In-app experiences to activate, retain, & understand users
Growth · 2023 · nudgenow.com


Unlock AI magic for elevated customer engagement, fast
AI · 2023 · tiledesk.com


Effortlessly discover API behaviour with a Chrome extension that automatically generates OpenAPI specifications in real time for any app or website.
Dev tools · 2023 · github.com