Challenging argparse with keyword dest="class"

Schimon Jehudah via Python-list <[email protected]> Mon, 29 Dec 2025 11:28:27 +0200
Newsgroups gmane.comp.python.general
Message-ID <[email protected]>
Greetings, one and all.

I am experimenting with module argparse.

I would be glad to know of your opinions about this concern.

Notice dest="class".


Python software
---------------

from argparse import ArgumentParser
parser = ArgumentParser(description="Slixfeed OSTN news service setup.")

parser.add_argument(
    "--class",
    choices=["address", "hostname", "tld"],
    dest="class")
args = parser.parse_args()
breakpoint()


Execute the software
--------------------

-> breakpoint()
(Pdb) args.class
*** SyntaxError: invalid syntax
(Pdb) 


Merry Christmas and a Happy New Year,
Schimon