Us

Use Python docstrings as exception messages

Hacker News

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.

Share card

Actual performance

7points
Made the leaderboard

Launch Intel predictions

Analyze your own launch →
Indie HackersFits the IH revenue-focused audience · Missing: supports, reddit linkedin, podcasting
68%68% 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.
Hacker NewsStrong engagement from HN community · Strong signals: io · Missing: https docs, excited, just released
50%50% predicted probability of success on Hacker News, based on ML models trained on real launch data.
nativeThis product was originally launched on this platform.
AppSumoMay struggle as an AppSumo deal · Missing: plus, platform, intuitive
47%47% predicted probability of success on AppSumo, based on ML models trained on real launch data.
TrustMRRLess likely to generate early MRR · Missing: mobile apps, ios, personal
43%43% predicted probability of success on TrustMRR, based on ML models trained on real launch data.
Product HuntUnlikely to reach the leaderboard · Strong signals: user · Missing: mac, agents, macos
34%34% predicted probability of success on Product Hunt, based on ML models trained on real launch data.
Acquire.comPre-revenue stage for this audience · Missing: arr, mrr, revenue
17%17% 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
14%14% predicted probability of success on BetaList, based on ML models trained on real launch data.

Correct prediction on native model

Similar products

Ho
How Not to Use Python52%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

How Not to Use Python

Hacker News5
Ba
Bare bones python socket byte-stream to messages wrapper56%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Bare bones python socket byte-stream to messages wrapper

Hacker News2
Us
Use libsqlite3 directly from Python with ctypes56%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Use libsqlite3 directly from Python with ctypes

Hacker News5
Us
Use Python to Generate Wikitables for US Census Data58%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Use Python to Generate Wikitables for US Census Data

Hacker News1
Cu
CustomStringParser ( Python)54%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

CustomStringParser ( Python)

Hacker News1
Lu
Lusernews is an implementation of lamernews in python48%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Lusernews is an implementation of lamernews in python

Hacker News1
Do
Do/While in Python55%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Do/While in Python

Hacker News4
Ga
Gatos, conCATenative functions for python54%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Gatos, conCATenative functions for python

Hacker News1
A
A wrapper around datetime, pytz and tzlocal for Python 3.2+38%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

A wrapper around datetime, pytz and tzlocal for Python 3.2+

Hacker News1
Pa
Parallelizing word2vec in Python55%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Parallelizing word2vec in Python

Hacker News3