nowfound

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.

  1. 1RT
  2. 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

  3. 3AP
  4. 4CI

    2011 · stephensugden.com

  5. 5

    A simple way to write, maintain, and share documentation

    2021

  6. 6CR
  7. 7DF
  8. 8DY

    2014 · github.com

  9. 9PC

    2017 · pybit.es

  10. 10MA
  11. 11FA
  12. 12RL
  13. 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

  14. 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

  15. 15AS

    2021 · amazon.com

  16. 16IM
  17. 17PP
  18. 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

  19. 19WP
  20. 20HN

    2019 · colab.research.google.com

  21. 21IP

    2019 · gist.github.com

  22. 22AC
  23. 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

  24. 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 →