msg314764 - (view) |
Author: Antony Lee (Antony.Lee) * |
Date: 2018-04-01 07:14 |
Python 3.6.4 In [15]: inspect.Parameter("foo", kind=inspect.Parameter.VAR_KEYWORD, default=42) --------------------------------------------------------------------------- ValueError Traceback (most recent call last) in () ----> 1 inspect.Parameter("foo", kind=inspect.Parameter.VAR_KEYWORD, default=42) /usr/lib/python3.6/inspect.py in __init__(self, name, kind, default, annotation) 2442 if kind in (_VAR_POSITIONAL, _VAR_KEYWORD): 2443 msg = '{} parameters cannot have default values'.format(kind) -> 2444 raise ValueError(msg) 2445 self._default = default 2446 self._annotation = annotation ValueError: 4 parameters cannot have default values Note the "interesting" error message that starts with "4 parameters ..." (yes, I guess that inspect.Parameter == 4 internally...). Probably just a matter of making the error f'{kind.name} parameters ...'. |
|
|
msg314798 - (view) |
Author: Nitish (nitishch) * |
Date: 2018-04-02 05:15 |
@Antony Lee since you know the fix, do you want to submit a PR? |
|
|
msg314799 - (view) |
Author: Nitish (nitishch) * |
Date: 2018-04-02 05:20 |
Also, _ParameterKind class has a __str__ method. So, I guess it's better to use "{!s}" in the format string instead of using kind.name. |
|
|
msg315900 - (view) |
Author: Dong-hee Na (corona10) *  |
Date: 2018-04-29 14:37 |
@Nitish I will take a look this issue. I agree with to use "{!s}" in the format string |
|
|
msg317289 - (view) |
Author: Dong-hee Na (corona10) *  |
Date: 2018-05-22 13:59 |
Can I get a code review for PR 6636? |
|
|
msg317995 - (view) |
Author: Dong-hee Na (corona10) *  |
Date: 2018-05-29 09:20 |
PR 6636 is ready to be merged :) |
|
|
msg318041 - (view) |
Author: Yury Selivanov (yselivanov) *  |
Date: 2018-05-29 15:04 |
New changeset a9cab433bbf02f3a1de59d14dc8f583181ffe2d5 by Yury Selivanov (Dong-hee Na) in branch 'master': bpo-33197: Update a error message of invalid inspect.Parameters. (GH-6636) https://github.com/python/cpython/commit/a9cab433bbf02f3a1de59d14dc8f583181ffe2d5 |
|
|
msg318046 - (view) |
Author: Yury Selivanov (yselivanov) *  |
Date: 2018-05-29 15:43 |
New changeset cb055bcc2bbfa5dcc6b0332305918a2118d9ebbc by Yury Selivanov (Miss Islington (bot)) in branch '3.7': bpo-33197: Update a error message of invalid inspect.Parameters. (GH-6636) (GH-7204) https://github.com/python/cpython/commit/cb055bcc2bbfa5dcc6b0332305918a2118d9ebbc |
|
|
msg318052 - (view) |
Author: Yury Selivanov (yselivanov) *  |
Date: 2018-05-29 15:59 |
New changeset 5e9e9db9d9b648d2326e2853dc07377e12498e3f by Yury Selivanov (Miss Islington (bot)) in branch '3.6': bpo-33197: Update a error message of invalid inspect.Parameters. (GH-6636) (#7205) https://github.com/python/cpython/commit/5e9e9db9d9b648d2326e2853dc07377e12498e3f |
|
|
msg319006 - (view) |
Author: Dong-hee Na (corona10) *  |
Date: 2018-06-08 02:13 |
@yselivanov Please take a look PR 7206 :) |
|
|
msg319014 - (view) |
Author: Yury Selivanov (yselivanov) *  |
Date: 2018-06-08 03:46 |
New changeset 4aa3006619392438b0775a2f488bbe9e7a22c468 by Yury Selivanov (Dong-hee Na) in branch 'master': bpo-33197: Add description property for _ParameterKind. (GH-7206) https://github.com/python/cpython/commit/4aa3006619392438b0775a2f488bbe9e7a22c468 |
|
|
msg319015 - (view) |
Author: Yury Selivanov (yselivanov) *  |
Date: 2018-06-08 03:46 |
Thanks! |
|
|
msg319060 - (view) |
Author: Yury Selivanov (yselivanov) *  |
Date: 2018-06-08 13:24 |
We forgot to add "versionadded: 3.8" tag to the documentation of ParameterKind.description. Dong-hee Na, could you please make a PR to add it? |
|
|
msg319069 - (view) |
Author: Dong-hee Na (corona10) *  |
Date: 2018-06-08 14:29 |
Sure, I will send a PR soon. |
|
|
msg319081 - (view) |
Author: Dong-hee Na (corona10) *  |
Date: 2018-06-08 16:04 |
@yselivanov Please take a look PR 7536 :) Thanks! |
|
|
msg319083 - (view) |
Author: Yury Selivanov (yselivanov) *  |
Date: 2018-06-08 16:07 |
> @yselivanov > Please take a look PR 7536 :) Thanks! Please stop posting comments like this frequently. They are highly distractive. |
|
|
msg319084 - (view) |
Author: Yury Selivanov (yselivanov) *  |
Date: 2018-06-08 16:07 |
New changeset 4f54867e29af93779922ff23df542f2d5df4c4ee by Yury Selivanov (Dong-hee Na) in branch 'master': bpo-33197: Add versionadded tag to the documentation of ParameterKind (GH-7536) https://github.com/python/cpython/commit/4f54867e29af93779922ff23df542f2d5df4c4ee |
|
|