You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Seems useless at first glance, but may be very helpful when there is a bunch of similar programs which inherit from each other.
E. g.
classProgram1:
def__init__(self):
self.argparser=ArgumentParser(...)
self.argparser.add()
...
self.argparser.add() # lots of argumentsdefrun(self):
args=self.argparser.parse()
# Program workflow
...
classProgram2(Program1):
def__init__(self):
super().__init__()
self.argparser.add('additional argument specific to Program2 only')
self.argparser.remove('argument useless in Program2') # <-- method to be added
It would be useful to have official API to do this trick.
The text was updated successfully, but these errors were encountered:
Unless / until more people request this, perhaps you can implement it by creating your own subclass of ConfigArgParse (or by accessing internal data structures like self._actions)?
Method to remove argument by name.
Seems useless at first glance, but may be very helpful when there is a bunch of similar programs which inherit from each other.
E. g.
It would be useful to have official API to do this trick.
The text was updated successfully, but these errors were encountered: