Hacker News new | ask | show | jobs
by Daishiman 299 days ago
All due respect but Typer looks like the kind of library that you want to use after your CLI has enough args that you wouldn't be able to get away with the sort of "Hello World" simplicity that you pine for.

Nobody's stopping you from manually parsing a couple of arguments. I still do it all the time and it's OK. If anything the magic of gradual typing is that you get to use it as necessity arises.

2 comments

I think your completely fair in pointing out that only a deeply troubled person would write this up as a generic version of "hello world", it's a silly example and I was at least partly going OTT for comic effect.

That said, I think it's true that production python tends to look more like my example, and less `print("hello world")`.

Typer is very convenient. I don't believe anyone manually parses arguments manually in Python where we have argparse in the standard library, and Typer is a step forward from that.
I really want to like typer, and frequently go down the rabbit hole of rewriting all my argparse into typer, but I keep getting put off by it's high import cost and that development seems to be a bit up in the air (see https://github.com/fastapi/typer/issues/678#issuecomment-319...). A shame because otherwise it's a really nice library!