Message133481
| Author |
rhettinger |
| Recipients |
rhettinger |
| Date |
2011年04月10日.21:11:39 |
| SpamBayes Score |
8.495973e-06 |
| Marked as misclassified |
No |
| Message-id |
<1302469900.48.0.983863495872.issue11823@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
The argument to CALL_FUNCTION is overloaded to show both the number of positional arguments and keyword arguments (shifted by 8-bits):
>>> dis("foo(10, opt=True)")
1 0 LOAD_NAME 0 (foo)
3 LOAD_CONST 0 (10)
6 LOAD_CONST 1 ('opt')
9 LOAD_CONST 2 (True)
12 CALL_FUNCTION 257
15 RETURN_VALUE
It is not obvious that the 257 argument causes three stack arguments to be popped.
The disassembly should add a parenthetical to explain the composition:
>>> dis("foo(10, opt=True)")
1 0 LOAD_NAME 0 (foo)
3 LOAD_CONST 0 (10)
6 LOAD_CONST 1 ('opt')
9 LOAD_CONST 2 (True)
12 CALL_FUNCTION 257 (1 positional, 1 keyword pair)
15 RETURN_VALUE |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2011年04月10日 21:11:40 | rhettinger | set | recipients:
+ rhettinger |
| 2011年04月10日 21:11:40 | rhettinger | set | messageid: <1302469900.48.0.983863495872.issue11823@psf.upfronthosting.co.za> |
| 2011年04月10日 21:11:39 | rhettinger | link | issue11823 messages |
| 2011年04月10日 21:11:39 | rhettinger | create |
|