Alternatives
Products that do what Use Python docstrings as exception messages does
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.
- 1RT
2022 · github.com
- 2IW
My book titled "Python re(gex)?" is free to download through this weekend [1][2] The book covers both 're' and 'regex' modules, has plenty of examples and chapters also have cheatsheets and exercises. Code snippets, exercises, sample chapters, etc are available on GitHub repo [3] I used pandoc+xelatex [4] to generate the pdf. [1] https://gumroad.com/l/py_regex [2] https://leanpub.com/py_regex [3] https://github.com/learnbyexample/py_regular_expressions [4]…
2019
- 3AP
2015 · github.com
- 4CI
2011 · stephensugden.com
- 5

- 6CR
2015 · crashbreak.com
- 7DF
2019 · github.com
- 8DY
2014 · github.com
- 9PC
2017 · pybit.es
- 10MA
2020 · github.com
- 11FA
2013 · shopkick.github.com
- 12RL
2020 · github.com
- 13IW
Background: I've been working on a book to help developers learn and write idiomatic Python. It's taken far longer than I imagined, but today I made it available for purchase (http://www.jeffknupp.com/writing-idiomatic-python-ebook). The automated build and test system I'm using is ridiculous. It uses: virtualenv, tox, pytest, coverage, doctest, pandoc, make, xelatex, makeindex, and a ~200 line Python script to collect and format the output. The details of the build/test system I created are described in detail here:…
2013
- 14MS
@cmpyl Tweet a line of python at it (right now it works best with math) and it'll tweet back at you the return value. Ex: https://twitter.com/#!/cmpyl/status/186850674053615616 Pretty useless little bot but it will be cool to see what sort of wild one liners it finds.
2012
- 15AS
2021 · amazon.com
- 16IM
2021 · codereview.doctor
- 17PP
2021 · prettyprintplease.com
- 18IW
Shelon: https://github.com/housni/sheldon It's not a framework, it's a library. It attempts to mimic function names in Python. Most functions work in Bash 4.3+ but there are those that work on older versions. The 'help' target in Makefile is on crack! Check the issues in that repo for upcoming features. Useful for DevOps Engineers or anyone who has to write Bash scripts.
2018
- 19WP
2018 · github.com
- 20HN
2019 · colab.research.google.com
- 21IP
2019 · gist.github.com
- 22AC
2013 · platipy.com
- 23OP
Hello HN, Pietro here! I've been really excited to see the recent buzz around MCP and all the cool things people are building with it. Though, the fact that you can use it only through desktop apps really seemed wrong and prevented me for trying most examples, so I wrote a simple client, then I wrapped into some class, and I ended up creating a python package that abstracts some of the async uglyness. You need: * one of those MCPconfig JSONs * 6 lines of code and you can have an agent use the MCP tools from python. The structure is simple: an MCP client creates and manages the connection and…
2025 · github.com
- 24AL
Inspired by Simon Willison's blog post that was catalyzed by this HN post: https://news.ycombinator.com/item?id=34598024 wasm_exec is a Wasm-powered, sandboxed implementation of exec() for safely running dynamic Python code There are number of use-cases emerging that require arbitrary code execution, often code that is generated by LLMs (Large Language Models) like ChatGPT. This can enable some really cool functionality - like generative BI or website generation - but also introduce a massive security flaw if implemented via eval() or exec(). This is because arbitrary code can…
2023 · github.com
Ranked by how close each launch is in meaning, then by votes. Refine with a description →