[issue33216] Wrong order of stack for CALL_FUNCTION_VAR and CALL_FUNCTION_VAR_KW

2018-05-07 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
priority: normal -> release blocker

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33216] Wrong order of stack for CALL_FUNCTION_VAR and CALL_FUNCTION_VAR_KW

2018-04-03 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

I confirm that this issue is 3.5-only. Before 3.5 the order matched the 
documentation. After 3.5 these opcodes were completely rewritten and they use 
now other way of passing arguments.

--
nosy: +serhiy.storchaka

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33216] Wrong order of stack for CALL_FUNCTION_VAR and CALL_FUNCTION_VAR_KW

2018-04-03 Thread Ned Deily

Change by Ned Deily :


--
assignee: docs@python -> larry
nosy:  -ned.deily

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33216] Wrong order of stack for CALL_FUNCTION_VAR and CALL_FUNCTION_VAR_KW

2018-04-03 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
nosy: +larry, ned.deily

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33216] Wrong order of stack for CALL_FUNCTION_VAR and CALL_FUNCTION_VAR_KW

2018-04-03 Thread Manuel Vazquez Acosta

Manuel Vazquez Acosta  added the comment:

Correction, the documentation for CALL_FUNCTION_VAR said:

Calls a function. *argc* is interpreted as in :opcode:`CALL_FUNCTION`. The top 
element on the stack contains the variable argument list, followed by keyword 
and positional arguments.


In a previous comment I pasted the version I'm putting in the PR.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33216] Wrong order of stack for CALL_FUNCTION_VAR and CALL_FUNCTION_VAR_KW

2018-04-03 Thread Manuel Vazquez Acosta

Change by Manuel Vazquez Acosta :


--
keywords: +patch
pull_requests: +6075
stage:  -> patch review

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33216] Wrong order of stack for CALL_FUNCTION_VAR and CALL_FUNCTION_VAR_KW

2018-04-03 Thread Manuel Vazquez Acosta

New submission from Manuel Vazquez Acosta :

The documentation of the dis module says that:

  CALL_FUNCTION_VAR (argc)

   Calls a function. *argc* is interpreted as in CALL_FUNCTION. The
   top elements on the stack are the keyword arguments, followed by the
   variable argument list, and then the positional arguments.

However, inspecting the how ``f(b=1, *args)`` is actually compiled shows a 
different order:

   >>> import dis
   >>> dis.dis(compile('f(b=1, *args)', '<>', 'eval'))

  1   0 LOAD_NAME0 (f)
  3 LOAD_NAME1 (args)
  6 LOAD_CONST   0 ('b')
  9 LOAD_CONST   1 (1)
 12 CALL_FUNCTION_VAR  256 (0 positional, 1 keyword pair)
 15 RETURN_VALUE

Notice that the top of the stack contains the explicit keyword arguments.

The documentation of CALL_FUNCTION_VAR_KW is also incorrect.

--
assignee:  -> docs@python
components: +Documentation
nosy: +docs@python
title: CALL_FUNCTION_VAR -> Wrong order of stack for CALL_FUNCTION_VAR and 
CALL_FUNCTION_VAR_KW
versions: +Python 3.5

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com