argparse modify

Dennis Lee Bieber wlfraed at ix.netcom.com
Thu Jun 23 18:32:34 EDT 2022


On Thu, 23 Jun 2022 18:57:31 +0200, "Dieter Maurer" <dieter at handshake.de>
declaimed the following:

>??? ???? wrote at 2022-6-23 15:31 +0300:
>>how to solve this (argparse)

>>    MAXREPEAT = _NamedIntConstant(32,name=str(32))
>>TypeError: 'name' is an invalid keyword argument for int()
>
>This does not look like an `argparse` problem:
>the traceback comes from `oracle/RTR.py`.

	And the listed code looks quite suspicious to me...

>>     class _NamedIntConstant(int):
>>         def __init__(cls, value):
>>             self = super(_NamedIntConstant, cls).__init__(cls, value)
>>             self.name = name
>>             return self

	There does not appear to be any provision for keyword arguments at all.
The only use of "name" is to an undefined object.


-- 
	Wulfraed                 Dennis Lee Bieber         AF6VN
	wlfraed at ix.netcom.com    http://wlfraed.microdiversity.freeddns.org/


More information about the Python-list mailing list