<p dir="ltr"><br>
On 4 Nov 2013 03:00, "R. David Murray" <<a href="mailto:rdmurray@bitdance.com">rdmurray@bitdance.com</a>> wrote:<br>
><br>
> I came across this in the VIM documentation:<br>
><br>
>     Vim can be built in four ways (:version output):<br>
>     1. No Python support        (-python, -python3)<br>
>     2. Python 2 support only    (+python or +python/dyn, -python3)<br>
>     3. Python 3 support only    (-python, +python3 or +python3/dyn)<br>
>     4. Python 2 and 3 support   (+python/dyn, +python3/dyn)<br>
><br>
>     Some more details on the special case 4:<br>
><br>
>     When Python 2 and Python 3 are both supported they must be loaded dynamically.<br>
><br>
>     When doing this on Linux/Unix systems and importing global symbols, this leads<br>
>     to a crash when the second Python version is used.  So either global symbols<br>
>     are loaded but only one Python version is activated, or no global symbols are<br>
>     loaded. The latter makes Python's "import" fail on libraries that expect the<br>
>     symbols to be provided by Vim.<br>
><br>
> I've never played with embedding Python.  Does this make sense to<br>
> anyone who has?  Is there some limitation in our embedding and/or<br>
> import machinery here, or is this more likely to be a shortcoming on<br>
> the VIM side?<br>
><br>
> Mostly I'm asking out of curiosity in hopes of learning something;<br>
> I doubt I'll have enough motivation to make time to work on solving this.</p>
<p dir="ltr">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.</p>

<p dir="ltr">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, though).</p>

<p dir="ltr">Cheers,<br>
Nick.</p>
<p dir="ltr">><br>
> --David<br>
> _______________________________________________<br>
> Python-Dev mailing list<br>
> <a href="mailto:Python-Dev@python.org">Python-Dev@python.org</a><br>
> <a href="https://mail.python.org/mailman/listinfo/python-dev">https://mail.python.org/mailman/listinfo/python-dev</a><br>
> Unsubscribe: <a href="https://mail.python.org/mailman/options/python-dev/ncoghlan%40gmail.com">https://mail.python.org/mailman/options/python-dev/ncoghlan%40gmail.com</a><br>
</p>