[issue29299] Argument Clinic: Fix signature of optional positional-only arguments

2019-03-15 Thread Rémi Lapeyre
Rémi Lapeyre added the comment: Thanks for the explanation. > And *that* would be a lot of code. Would an effort to make inspect support this be appreciated or do you think this is not important? -- nosy: +remi.lapeyre versions: +Python 3.8 ___

[issue29299] Argument Clinic: Fix signature of optional positional-only arguments

2019-03-15 Thread Larry Hastings
Larry Hastings added the comment: Argument Clinic can currently only generate signatures for functions whose signatures can be represented in Python. This is because the signatures are parsed by the inspect module, which in turn uses the ast module to generate a parse tree; it then

[issue29299] Argument Clinic: Fix signature of optional positional-only arguments

2017-01-17 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Please don't change this part of Argument Clinic without Larry. There were several attempts to solve this problem, I don't like current status, but this is Larry's decision. -- ___ Python tracker

[issue29299] Argument Clinic: Fix signature of optional positional-only arguments

2017-01-17 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: The problem is that func(mandatory_arg1, mandatory_arg2[, optional_arg3[, optinal_arg4]]) is not compatible with the inspect module. In many case a meaningful default value was added if this is possible. For example the Python default shown in the

[issue29299] Argument Clinic: Fix signature of optional positional-only arguments

2017-01-17 Thread STINNER Victor
STINNER Victor added the comment: This issue is blocking me to convert more functions to Argument Clinic. See for example attached getattr_ac.patch which converts getattr() to AC. Without ac_optional_positional.patch, AC generates the signature: "getattr($module, object, name,

[issue29299] Argument Clinic: Fix signature of optional positional-only arguments

2017-01-17 Thread STINNER Victor
STINNER Victor added the comment: See also issue #20291: "Argument Clinic should understand *args and **kwargs parameters". -- ___ Python tracker ___

[issue29299] Argument Clinic: Fix signature of optional positional-only arguments

2017-01-17 Thread STINNER Victor
STINNER Victor added the comment: List of functions modified when Argument Clinic is run to regenerate .c.h files: builtin_format builtin_getattr builtin_input builtin_sum cmath_log _codecs_ascii_decode _codecs_ascii_encode _codecs_charmap_decode _codecs_charmap_encode _codecs_code_page_encode

[issue29299] Argument Clinic: Fix signature of optional positional-only arguments

2017-01-17 Thread STINNER Victor
New submission from STINNER Victor: When a function has only positional arguments and at least one argument is optional, the expected signature is: func(mandatory_arg1, mandatory_arg2[, optional_arg3[, optinal_arg4]]) For example, the signature of format() is inconsistent with its