[issue18531] Undocumented different between METH_KEYWORDS and **kws

2021-12-06 Thread Irit Katriel
Change by Irit Katriel : -- resolution: -> fixed stage: -> resolved status: pending -> closed ___ Python tracker ___ ___

[issue18531] Undocumented different between METH_KEYWORDS and **kws

2021-11-29 Thread Irit Katriel
Irit Katriel added the comment: This seems fixed in 3.11: >>> from collections import defaultdict >>> '{foo}{bar}'.format(**defaultdict(str)) Traceback (most recent call last): File "", line 1, in KeyError: 'foo' -- nosy: +iritkatriel status: open -> pending

[issue18531] Undocumented different between METH_KEYWORDS and **kws

2016-05-16 Thread Roundup Robot
Roundup Robot added the comment: New changeset e3283b4ae61d by Serhiy Storchaka in branch '3.5': Backported tests for issue #18531. https://hg.python.org/cpython/rev/e3283b4ae61d New changeset 621e0a3249c2 by Serhiy Storchaka in branch '2.7': Backported tests for issue #18531.

[issue18531] Undocumented different between METH_KEYWORDS and **kws

2016-05-09 Thread Eric V. Smith
Eric V. Smith added the comment: Oops, sorry. I'm an idiot. I was running in a venv where python was python3. Checking with my installed 2.7.10, I see the expected error. -- ___ Python tracker

[issue18531] Undocumented different between METH_KEYWORDS and **kws

2016-05-08 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Now this is just the documentation issue. I think the change of the behavior in 3.6 should be documented too, but I even don't know where. -- ___ Python tracker

[issue18531] Undocumented different between METH_KEYWORDS and **kws

2016-05-08 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: > I'm not sure PyObject_GetItem instead of PyDict_GetItem in 3.x completely > explains things, because the code in issue 6081 also works in 2.7. It doesn't work to me in current develop 2.7.11+. What version did you test? --

[issue18531] Undocumented different between METH_KEYWORDS and **kws

2016-05-08 Thread Eric V. Smith
Eric V. Smith added the comment: I'm not sure PyObject_GetItem instead of PyDict_GetItem in 3.x completely explains things, because the code in issue 6081 also works in 2.7. But I don't think it's terribly important in any event, as long as we understand the 3.x difference. Thanks for

[issue18531] Undocumented different between METH_KEYWORDS and **kws

2016-05-08 Thread Roundup Robot
Roundup Robot added the comment: New changeset e4835b1ed7b1 by Serhiy Storchaka in branch 'default': Issue #18531: Single var-keyword argument of dict subtype was passed https://hg.python.org/cpython/rev/e4835b1ed7b1 -- nosy: +python-dev ___ Python

[issue18531] Undocumented different between METH_KEYWORDS and **kws

2016-05-08 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: str.format() uses PyDict_GetItem() in 2.7, but PyObject_GetItem() in 3.x. A comment before: /* Use PyObject_GetItem instead of PyDict_GetItem because this code is no longer just used with kwargs. It might be passed a non-dict

[issue18531] Undocumented different between METH_KEYWORDS and **kws

2016-05-06 Thread Eric V. Smith
Eric V. Smith added the comment: Okay. Adding back 3.5 and 2.7, in case someone wants to document the behavior there. I'm not sure if we fix docs in 3.4 still. -- versions: +Python 2.7, Python 3.5 ___ Python tracker

[issue18531] Undocumented different between METH_KEYWORDS and **kws

2016-05-06 Thread Barry A. Warsaw
Barry A. Warsaw added the comment: On May 06, 2016, at 03:41 PM, Eric V. Smith wrote: >I agree it would be a 3.6 only change (and I've change the versions to >reflect that). The reason the other versions were included was because this was originally reported as a documentation bug. It should

[issue18531] Undocumented different between METH_KEYWORDS and **kws

2016-05-06 Thread Eric V. Smith
Eric V. Smith added the comment: I think it's okay to change this as far as str.format() goes. Interestingly enough, the motivating case to add str.format_map() in issue 6081 was exactly this kind of code. Although I notice that the example in that issue, which it shows as failing, works in

[issue18531] Undocumented different between METH_KEYWORDS and **kws

2016-05-06 Thread Barry A. Warsaw
Barry A. Warsaw added the comment: Eric should chime in on the str.format() implications. -- ___ Python tracker ___

[issue18531] Undocumented different between METH_KEYWORDS and **kws

2016-05-06 Thread Barry A. Warsaw
Changes by Barry A. Warsaw : -- nosy: +eric.smith ___ Python tracker ___ ___

[issue18531] Undocumented different between METH_KEYWORDS and **kws

2016-05-06 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Proposed patch converts var-keyword arguments to exact dict. Since it changes the behavior of str.format() it can be pushed only in 3.6. -- Added file: http://bugs.python.org/file42746/ceval_kwargs_exact_dict.patch

[issue18531] Undocumented different between METH_KEYWORDS and **kws

2016-05-06 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : Added file: http://bugs.python.org/file42743/test_args_kwargs_types.patch ___ Python tracker ___

[issue18531] Undocumented different between METH_KEYWORDS and **kws

2016-05-06 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : Removed file: http://bugs.python.org/file42742/test_args_kwargs_types.patch ___ Python tracker ___

[issue18531] Undocumented different between METH_KEYWORDS and **kws

2016-05-06 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Yet one difference is that kwargs can be NULL in C function if no keyword arguments are supplied. Here is a patch that adds tests for exact types of args and kwargs arguments in C functions. I think that we should keep passing NULL as kwargs for

[issue18531] Undocumented different between METH_KEYWORDS and **kws

2015-10-30 Thread Evgeny Kapun
Changes by Evgeny Kapun : -- nosy: +abacabadabacaba ___ Python tracker ___ ___

[issue18531] Undocumented different between METH_KEYWORDS and **kws

2013-07-22 Thread Barry A. Warsaw
New submission from Barry A. Warsaw: A colleague discovered an interesting implementation different between C-defined functions and Python-defined functions called with **kws arguments. He tried to do this: from collections import defaultdict '{foo}{bar}'.format(**defaultdict(str)) '' He

[issue18531] Undocumented different between METH_KEYWORDS and **kws

2013-07-22 Thread Alex Gaynor
Alex Gaynor added the comment: I'll confirm that PyPy raises a KeyError on the format() code. -- nosy: +alex ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18531 ___