[Python-Dev] python2 and python3 and vim
ncoghlan at gmail.com
Sun Nov 3 23:04:27 CET 2013
On 4 Nov 2013 03:00, "R. David Murray" <rdmurray at bitdance.com> wrote:
> I came across this in the VIM documentation:
> Vim can be built in four ways (:version output):
> 1. No Python support (-python, -python3)
> 2. Python 2 support only (+python or +python/dyn, -python3)
> 3. Python 3 support only (-python, +python3 or +python3/dyn)
> 4. Python 2 and 3 support (+python/dyn, +python3/dyn)
> Some more details on the special case 4:
> When Python 2 and Python 3 are both supported they must be loaded
> When doing this on Linux/Unix systems and importing global symbols,
> to a crash when the second Python version is used. So either global
> are loaded but only one Python version is activated, or no global
> loaded. The latter makes Python's "import" fail on libraries that
> symbols to be provided by Vim.
> I've never played with embedding Python. Does this make sense to
> anyone who has? Is there some limitation in our embedding and/or
> import machinery here, or is this more likely to be a shortcoming on
> the VIM side?
> Mostly I'm asking out of curiosity in hopes of learning something;
> I doubt I'll have enough motivation to make time to work on solving this.
Essentially what Greg said - we export many of the same symbols from both
shared libraries, so if you try to load both CPython 2 and 3 into one
process, the dynamic linker isn't going to be happy about it at all.
Since making it work would be a lot of work for minimal benefit, the most
that could realistically be done is to make it fail a little more
gracefully (I believe that would need to be done on the Vim side of things,
> Python-Dev mailing list
> Python-Dev at python.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Python-Dev