Use Python docstrings as exception messages
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 cardActual performance
Launch Intel predictions
Analyze your own launch →Correct prediction on native model
Similar products
How Not to Use Python
Bare bones python socket byte-stream to messages wrapper
Use libsqlite3 directly from Python with ctypes
Use Python to Generate Wikitables for US Census Data
CustomStringParser ( Python)
Lusernews is an implementation of lamernews in python
Do/While in Python
Gatos, conCATenative functions for python
A wrapper around datetime, pytz and tzlocal for Python 3.2+
Parallelizing word2vec in Python