Re: lxml parsing with validation and target?

2021-11-03 Thread Robin Becker
On 02/11/2021 12:55, Robin Becker wrote: I'm having a problem using lxml.etree to make a treebuilding parser that validates; I have test code where invalid xml is detected and an error raised when the line below target=ET.TreeBuilder(), is commented out. . I managed to overcome this p

argparse - 3rd arg only valid for one of two mutually exclusive args?

2021-11-03 Thread Loris Bennett
Hi, With argparse's add_mutually_exclusive_group() I can add mutually exclusive args, but how do I deal with a 3rd arg which only makes sense for one of the mutually exclusive args? More generally I suppose I am interested in having something like [ --foo (--foobar) | --bar (--barfoo) ] if th