Growing India News, world news, nation news, our news, people's news, grow news, entertainment, fashion, movies, tech, automobile and many more..
Saturday, October 7, 2023
Show HN: Use Python docstrings as exception messages https://ift.tt/AbLecG6
Show HN: 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. https://ift.tt/6nmrMaA October 6, 2023 at 11:39PM
Subscribe to:
Post Comments (Atom)
Show HN: Littlebird – Screenreading is the missing link in AI https://ift.tt/KtS34WN
Show HN: Littlebird – Screenreading is the missing link in AI https://littlebird.ai/ March 23, 2026 at 11:09PM
-
Show HN: An AI logo generator that can also generate SVG logos Hey everyone, I've spent the past 2 weeks building an AI logo generator, ...
-
Breaking #FoxNews Alert : Number of dead rises after devastating tornadoes, Kentucky governor announces — R Karthickeyan (@RKarthickeyan1)...
-
Show HN: Simple Gantt Chart Software https://ift.tt/sa3dQKF May 7, 2022 at 12:39PM
No comments:
Post a Comment