| To: vim_dev@googlegroups.com |
| Subject: Patch 7.3.881 |
| Fcc: outbox |
| From: Bram Moolenaar <Bram@moolenaar.net> |
| Mime-Version: 1.0 |
| Content-Type: text/plain; charset=UTF-8 |
| Content-Transfer-Encoding: 8bit |
| |
| |
| Patch 7.3.881 |
| Problem: Python list does not work correctly. |
| Solution: Fix it and add a test. (Yukihiro Nakadaira) |
| Files: src/testdir/test86.in, src/testdir/test86.ok, src/if_py_both.h |
| |
| |
| |
| |
| |
| *** 321,326 **** |
| --- 321,351 ---- |
| :py trace_main() |
| :py sys.settrace(None) |
| :$put =string(l) |
| + :" |
| + :" Slice |
| + :py ll = vim.bindeval('[0, 1, 2, 3, 4, 5]') |
| + :py l = ll[:4] |
| + :$put =string(pyeval('l')) |
| + :py l = ll[2:] |
| + :$put =string(pyeval('l')) |
| + :py l = ll[:-4] |
| + :$put =string(pyeval('l')) |
| + :py l = ll[-2:] |
| + :$put =string(pyeval('l')) |
| + :py l = ll[2:4] |
| + :$put =string(pyeval('l')) |
| + :py l = ll[4:2] |
| + :$put =string(pyeval('l')) |
| + :py l = ll[-4:-2] |
| + :$put =string(pyeval('l')) |
| + :py l = ll[-2:-4] |
| + :$put =string(pyeval('l')) |
| + :py l = ll[:] |
| + :$put =string(pyeval('l')) |
| + :py l = ll[0:6] |
| + :$put =string(pyeval('l')) |
| + :py l = ll[-10:10] |
| + :$put =string(pyeval('l')) |
| :endfun |
| :" |
| :call Test() |
| |
| |
| |
| *** 65,67 **** |
| --- 65,78 ---- |
| vim: Vim(let):E859: |
| [1] |
| [1, 10, 11, 10, 11, 10, 11, 10, 11, 10, 11, 10, 1] |
| + [0, 1, 2, 3] |
| + [2, 3, 4, 5] |
| + [0, 1] |
| + [4, 5] |
| + [2, 3] |
| + [] |
| + [2, 3] |
| + [] |
| + [0, 1, 2, 3, 4, 5] |
| + [0, 1, 2, 3, 4, 5] |
| + [0, 1, 2, 3, 4, 5] |
| |
| |
| |
| *** 1139,1145 **** |
| |
| for (i = 0; i < n; ++i) |
| { |
| ! PyObject *item = ListItem(self, i); |
| if (item == NULL) |
| { |
| Py_DECREF(list); |
| --- 1139,1145 ---- |
| |
| for (i = 0; i < n; ++i) |
| { |
| ! PyObject *item = ListItem(self, first + i); |
| if (item == NULL) |
| { |
| Py_DECREF(list); |
| |
| |
| |
| *** 730,731 **** |
| --- 730,733 ---- |
| { /* Add new patch number below this line */ |
| + /**/ |
| + 881, |
| /**/ |
| |
| -- |
| hundred-and-one symptoms of being an internet addict: |
| 123. You ask the car dealer to install an extra cigarette lighter |
| on your new car to power your notebook. |
| |
| /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ |
| /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ |
| \\\ an exciting new programming language -- http://www.Zimbu.org /// |
| \\\ help me help AIDS victims -- http://ICCF-Holland.org /// |