Hi Nikolay, Bram and List, Le Tue, Nov 24, 2015 at 07:15:35AM +0300, Nikolay Pavlov a écrit : > 2015-11-24 1:14 GMT+03:00 Bram Moolenaar <[email protected]>: > > > > > Nikolay Pavlov wrote: > > > > 2015-11-21 16:41 GMT+03:00 Damien <[email protected]>: > > > > > > Hi list, > > > > > > > > Vim function `py{,3}eval()` cannot used with a void expression. > > > > :call pyeval('None') > > > > E859: Failed to convert returned python object to vim value > > > > > > > > This is expected? > > > > > > > > > > Yes, of course. Pyeval is for getting result from Python expressions, for > > > executing expressions for their side-effects there is `:python` and > > > `:execute`. And VimL does not have `None` equivalent to convert Python > > > `None` to it. > > > > Well, it's possible that a Python function returns None in some > > situations. Would be good to be able to handle that in a simple way. > > > > We do have the problem that there is no equivalent of None. Perhaps the > > simples is to use the string 'None'. Using something like zero is more > > easily confused with a valid return value.
Personally, I thinks that `0` is a safe value, link an user function without `return` statements. Thank for the explanation. Damien -- -- 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/d/optout.
