[issue36936] CALL_FUNCTION_KW opcode: keyword names must be non-empty

2019-05-22 Thread Petr Viktorin
Petr Viktorin added the comment: Closing per discussion in https://github.com/python/cpython/pull/13357 -- resolution: -> not a bug stage: patch review -> resolved status: open -> closed ___ Python tracker

[issue36936] CALL_FUNCTION_KW opcode: keyword names must be non-empty

2019-05-16 Thread Jeroen Demeyer
Jeroen Demeyer added the comment: Adding that assertion allows future optimizations and simplifications: with the assertion, "keyword arguments are passed" becomes equivalent to kwnames != NULL instead of kwnames != NULL && PyTuple_GET_SIZE(kwnames) > 0 This may not be useful right now

[issue36936] CALL_FUNCTION_KW opcode: keyword names must be non-empty

2019-05-16 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Then I do not see a reason to add an assertion. -- ___ Python tracker ___ ___ Python-bugs-list

[issue36936] CALL_FUNCTION_KW opcode: keyword names must be non-empty

2019-05-16 Thread Jeroen Demeyer
Jeroen Demeyer added the comment: > What happens when pass an empty tuple? The way how bytecode is compiled, that doesn't actually happen so it's an entirely hypothetical question. The various XXX_FastCallKeywords functions seem to allow passing an empty tuple to mean "no keyword arguments"

[issue36936] CALL_FUNCTION_KW opcode: keyword names must be non-empty

2019-05-16 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: What happens when pass an empty tuple? -- nosy: +serhiy.storchaka ___ Python tracker ___ ___ Py

[issue36936] CALL_FUNCTION_KW opcode: keyword names must be non-empty

2019-05-16 Thread Jeroen Demeyer
Change by Jeroen Demeyer : -- keywords: +patch pull_requests: +13266 stage: -> patch review ___ Python tracker ___ ___ Python-bugs-

[issue36936] CALL_FUNCTION_KW opcode: keyword names must be non-empty

2019-05-16 Thread Jeroen Demeyer
New submission from Jeroen Demeyer : Document and add an assertion that the "keyword names" tuple of the CALL_FUNCTION_KW opcode must be non-empty. This is already the case with the current compiler: if there are no keyword arguments in a call, then the CALL_FUNCTION_KW opcode is not used. I