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.
let result = pyeval(expression)
if result != 'None'
" do something with result
endif
--
I'm writing a book. I've got the page numbers done.
/// 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/d/optout.