[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kwrite-devel
Subject:    Re: Switching to Python 3
From:       Alex Turbov <i.zaufi () gmail ! com>
Date:       2013-11-12 17:11:20
Message-ID: CANktQtv2aJwtTuEMePFP6_2JLcNm8uU0E+qgv7+4BPtwGOMnfw () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


You ppl seem do not understand how that stuff works...

On Tue, Nov 12, 2013 at 8:32 PM, Todd <toddrjen@gmail.com> wrote:

> ... With something like iPython, it shouldn't be much more difficult to
> support both python 2 and python 3 than just one or the other, you just
> need either the user or the distro to set the right *command to execute*.
>

There is no "command to execute"! IPython provides a module to import from
other python apps (pate plugin, which is *embedded python app*). So, as
Philipp already replied, python_console_ipython plugin *just* import it! No
magic! No commands to execute or anything else... just "usual" import. And
what will be imported depends on what ipython provides in any particular
distro. For example, in gentoo, it is possible to have ipython "compiled"
for Py2 and Py3 at the same time. And command `ipython` will use a module
corresponding to the current default `python` version. But, Python version
the kate is linked w/ couldn't be changed at runtime! So, if we are linked
w/ Py3, python_console_ipython will import `ipython` module from python3
site packages dir. Same for py2...


> On Tue, Nov 12, 2013 at 8:36 PM, Sven Brauch <svenbrauch@googlemail.com>wrote:
>
it ends up using the version of ipython which kate was *linked* against.


kate do not (and can not) be *linked* against ipython! again, as Philipp
already said *it is not a native library*! it can't be used from C++, only
from Python. And it's up to distro makers to provide ipython module
compiled for the same Python version as kate... As I notice above there is
no problem to do so in gentoo. Dunno what about other distros: are they
provide bilingual python stuff for both versions or for "default" only...


> Setting two commands would only work if
> you would be happy with running the ipython CLI thingy in an existing
> terminal (e.g. konsole kpart), which is not what is currently being
> done -- ipython provides its own widget which is embedded in a
> toolview.
>

That is absolutely CRAZY idea! and better even wouldn't consider it...

PS. Personally I don't understand why you still discuss this... Definitely
if user wants to run smth Py2 specific from ipython, he will do it from
console (using `ipython` CLI). Why he ever want to run it from *ipython
embedded into kate* ??? As correctly being noticed by someone above,
ipython inside of kate is targeted to kate plugins developers... it is not
the same as `konsole` embeded into kate! it is not a general use tool!

[Attachment #5 (text/html)]

<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">You ppl seem do not \
understand how that stuff works...<br><br>On Tue, Nov 12, 2013 at 8:32 PM, Todd <span \
dir="ltr">&lt;<a href="mailto:toddrjen@gmail.com" \
target="_blank">toddrjen@gmail.com</a>&gt;</span> wrote:<br> <blockquote \
class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid \
rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div \
class="gmail_quote">... With something like iPython, it shouldn&#39;t be much more \
difficult to support both python 2 and python 3 than just one or the other, you just \
need either the user or the distro to set the right <b>command to execute</b>. <br> \
</div></div></div></blockquote><div><br></div><div>There is no &quot;command to \
execute&quot;! IPython provides a module to import from other python apps (pate \
plugin, which is *embedded python app*). So, as Philipp already replied, \
python_console_ipython plugin *just* import it! No magic! No commands to execute or \
anything else... just &quot;usual&quot; import. And what will be imported depends on \
what ipython provides in any particular distro. For example, in gentoo, it is \
possible to have ipython &quot;compiled&quot; for Py2 and Py3 at the same time. And \
command `ipython` will use a module corresponding to the current default `python` \
version. But, Python version the kate is linked w/ couldn&#39;t be changed at \
runtime! So, if we are linked w/ Py3, python_console_ipython will import `ipython` \
module from python3 site packages dir. Same for py2...<br> </div><div> \
<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px \
0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Tue, Nov 12, 2013 \
at 8:36 PM, Sven Brauch <span dir="ltr">&lt;<a \
href="mailto:svenbrauch@googlemail.com" \
target="_blank">svenbrauch@googlemail.com</a>&gt;</span> wrote:<br> \
</blockquote><div><blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid \
rgb(204,204,204);padding-left:1ex" class="gmail_quote">it ends up using the version \
of ipython which kate was <b>linked</b> against. \
</blockquote><div><br></div><div>kate do not (and can not) be *linked* against \
ipython! again, as Philipp already said *it is not a native library*! it can&#39;t be \
used from C++, only from Python. And it&#39;s up to distro makers to provide ipython \
module compiled for the same Python version as kate... As I notice above there is no \
problem to do so in gentoo. Dunno what about other distros: are they provide \
bilingual python stuff for both versions or for &quot;default&quot; only...<br> \
</div><div> </div><blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid \
rgb(204,204,204);padding-left:1ex" class="gmail_quote">Setting two commands would \
only work if<br> you would be happy with running the ipython CLI thingy in an \
existing<br> terminal (e.g. konsole kpart), which is not what is currently being<br>
done -- ipython provides its own widget which is embedded in a<br>
toolview.<br></blockquote>
<br></div><div>That is absolutely CRAZY idea! and better even wouldn&#39;t consider \
it...<br><br></div><div>PS. Personally I don&#39;t understand why you still discuss \
this... Definitely if user wants to run smth Py2 specific from ipython, he will do it \
from console (using `ipython` CLI). Why he ever want to run it from *ipython embedded \
into kate* ??? As correctly being noticed by someone above, ipython inside of kate is \
targeted to kate plugins developers... it is not the same as `konsole` embeded into \
kate! it is not a general use tool! <br> </div></div></div></div>



_______________________________________________
KWrite-Devel mailing list
KWrite-Devel@kde.org
https://mail.kde.org/mailman/listinfo/kwrite-devel


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic