[Python-ideas] argparse.py in version 3.8.2 Action=Custom ActionClass needs an option to have methods

2020-09-10 Thread rangapv08
Hi, Got the argparse() in version 3.8.2 and above the action=CusotmClass can have a user defined custom subclass and override the functionality in the def __init__() method. Along with this can we also have a built in custom method/methods that I can define under this custom Class, so that inste

[Python-ideas] Re: argparse.py in version 3.8.2 Action=Custom ActionClass needs an option to have methods

2020-09-10 Thread 2QdxY4RzWzUUiLuE
On 2020-09-10 at 11:45:37 -, [email protected] wrote: > Got the argparse() in version 3.8.2 and above the action=CusotmClass > can have a user defined custom subclass and override the functionality > in the def __init__() method. Along with this can we also have a built > in custom method/me

[Python-ideas] Re: argparse.py in version 3.8.2 Action=Custom ActionClass needs an option to have methods

2020-09-10 Thread Guido van Rossum
Rangarajan, You may be on to something but the description is a bit dense. Can you show some examples of how this would work, and contrast those with how the same thing would have to be done without your proposed feature? —Guido On Thu, Sep 10, 2020 at 05:47 wrote: > Hi, > > Got the argparse(

[Python-ideas] Re: argparse.py in version 3.8.2 Action=Custom ActionClass needs an option to have methods

2020-09-10 Thread Ranga Swamy
Hi Guido, Great to hear back from you. Currently we have the add_argument calling the custom action like shown below... Example: class MyAction(argparse.Action): def __init__(self, option_strings, dest, nargs=None, **kwargs): if nargs is not None: raise ValueError("nar