[–] 2 points 1 year ago (7 children)

why click is based on optparse and not argparse

Applies only to optional args long help

Applies only to subcommands short help

Special mention to how to document positional args. The docs explains the intentional lack of help kwarg for positional args.

./thing.py -h
./thing.py subcommand --help

Lists all the subcommands with one line short description for each subcommand.

Lists detailed docs of one subcommand

My opinion having used both argparse and click, click is simpler cleaner and less time consuming.

  • source
  • [–] [S] 2 points 1 year ago

    BTW, you can also have a short description instead suppressing the option. In example:

    parser.add_argument(
        "-s",
        "--sort",
        action="append",
        help="sort all game items by value of chosen key, before filter, *multi"
        if advanced_help
        else "sort all items",
    )
    

    instead hiding the option, with --help the short description "sort all items" is listed, while the advanced help would then show the long help. Just an additional thing with the above technique is possible.

  • source
  • [–] 1 point 1 year ago* (last edited 1 year ago)

    No endless scroll of algorithmic 'content'

    That's not the case. According to the docs,

    itter watch [mine|all|#chan|@user] would entail infinite scrolling of content.

    itter timeline [mine|all|#chan|@user] [<page>] although there is pagenate the content list is potentially infinite

    Admit it! There is no search algorithm for content filtering or finding contacts or blocked users.

    Whatever the object is, there is no search algorithm to traverse it intelligently.

    For example, say i'm super popular but with a tendency to ghost everyone. Like a stereotypical LINE user faced with unpopular opinions or topics. So list of unfollow'ed (aka blocked) users is approaching infinity.

    A truly admirable dedication to being a really horrible human being.

    At the local bar, me and my mates have a drinking game where they think up random search criteria to see the kinda categories of people which have been blocked. A weak or nonexistent search algorithm would mean not likely to leave the bar on our feet.

    Show me chicks with green hair that posts about both climate doom and vaccines being great for children. Living in USA, Canada, or New Zealand. That has a cat avatar and has either giant earrings or nose piercing.

    That should be simple enough.

    yep look at that! i ghosted five green haired freaks. Now drink!

  • source
  • [–] 3 points 1 year ago

    When I was using pycharm 2024 I had a plugin installed called "evaluate-async-code" and it was suuuuper helpful bc the codebase at work is primarily async python and not being able to debug async findings was always a pain, as outputs would be passed around and not always stored. I know, it's easy to store it as a variable, and it's just easier to get that value in that moment than realize you'll need to add one and restart the debugger.

  • source
  • view more: β€Ή prev