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


*** ../vim-7.3.880/src/testdir/test86.in        2013-02-20 16:54:24.000000000 
+0100
--- src/testdir/test86.in       2013-04-05 19:18:48.000000000 +0200
***************
*** 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()
*** ../vim-7.3.880/src/testdir/test86.ok        2013-02-20 16:54:24.000000000 
+0100
--- src/testdir/test86.ok       2013-04-05 19:18:48.000000000 +0200
***************
*** 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]
*** ../vim-7.3.880/src/if_py_both.h     2013-02-14 22:11:31.000000000 +0100
--- src/if_py_both.h    2013-04-05 19:27:46.000000000 +0200
***************
*** 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);
*** ../vim-7.3.880/src/version.c        2013-04-05 18:58:42.000000000 +0200
--- src/version.c       2013-04-05 19:31:59.000000000 +0200
***************
*** 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 -- [email protected] -- 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    ///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Raspunde prin e-mail lui