Re: Complete user-defined exception handling in IDLE

AndrĂ© Roberge <[email protected]> Sun, 20 Jun 2021 06:13:29 -0300
Newsgroups gmane.comp.python.idle
Message-ID <CAGMu_=o3TCz86vFEZsWtBu=d3PdwfbUn_Z=O_8rBOUfD7m9Y8A@mail.gmail.com>
--===============3967461141507352233==
Content-Type: multipart/alternative; boundary="00000000000094272505c52efa5e"

--00000000000094272505c52efa5e
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Sat, Jun 19, 2021 at 11:36 PM Terry Reedy <[email protected]> wrote:

> On 6/19/2021 5:36 PM, Andr=C3=A9 Roberge wrote:
>
> >  >>> from friendly.idle import *
>
> I hope you document the alternative for anyone wanting to isolate f.i
> functions: `import friendly.idle as fi` or
> `from friendly import idle as fi`.
>
> Documenting this is on my list of things to do.
I already have had similar feedback from another instructor who uses it
with the Jupyter module.

The reason I usually write "import *" is that I view the functions
why(), what(), where(), etc., like they are additional builtins available
in an interactive session. (They are not added to the builtins module.)



> In any case, fi executes in the user process.  Do you use the rpc
> connection to query linecache in the IDLE process?
>

Yes, I do.

>
>
> On the issue, I suggested de-serializing the original rather than
> recompiling.
>

It would make sense, if I knew how to access the information
using rpc. For SyntaxErrors and subclasses, all I need for the
analysis are the Exception argument (message, offset, lineno, etc.)
and the entire offending code.


Andr=C3=A9

--00000000000094272505c52efa5e
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"ltr"><div class=3D"gmail_default" style=3D"fon=
t-family:arial,helvetica,sans-serif;font-size:small"><br></div></div><br><d=
iv class=3D"gmail_quote"><div dir=3D"ltr" class=3D"gmail_attr">On Sat, Jun =
19, 2021 at 11:36 PM Terry Reedy &lt;<a href=3D"mailto:[email protected]">tj=
[email protected]</a>&gt; wrote:<br></div><blockquote class=3D"gmail_quote" st=
yle=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padd=
ing-left:1ex">On 6/19/2021 5:36 PM, Andr=C3=A9 Roberge wrote:<br><br>
&gt;=C2=A0 &gt;&gt;&gt; from friendly.idle import *<br>
<br>
I hope you document the alternative for anyone wanting to isolate f.i <br>
functions: `import friendly.idle as fi` or<br>
`from friendly import idle as fi`.<br>
<br></blockquote><div><div class=3D"gmail_default" style=3D"font-family:ari=
al,helvetica,sans-serif;font-size:small">Documenting this is on my list of =
things to do.=C2=A0</div><div class=3D"gmail_default" style=3D"font-family:=
arial,helvetica,sans-serif;font-size:small">I already have had similar feed=
back from another instructor who uses it</div><div class=3D"gmail_default" =
style=3D"font-family:arial,helvetica,sans-serif;font-size:small">with the J=
upyter module.</div><div class=3D"gmail_default" style=3D"font-family:arial=
,helvetica,sans-serif;font-size:small"><br></div><div class=3D"gmail_defaul=
t" style=3D"font-family:arial,helvetica,sans-serif;font-size:small">The rea=
son I usually write &quot;import *&quot; is that I view the functions</div>=
<div class=3D"gmail_default" style=3D"font-family:arial,helvetica,sans-seri=
f;font-size:small">why(), what(), where(), etc., like they are additional b=
uiltins available</div><div class=3D"gmail_default" style=3D"font-family:ar=
ial,helvetica,sans-serif;font-size:small">in an interactive session. (They =
are not added to the builtins module.)</div><br></div><div>=C2=A0</div><blo=
ckquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left=
:1px solid rgb(204,204,204);padding-left:1ex">
In any case, fi executes in the user process.=C2=A0 Do you use the rpc <br>
connection to query linecache in the IDLE process?<br></blockquote><div><br=
></div><div class=3D"gmail_default" style=3D"font-family:arial,helvetica,sa=
ns-serif;font-size:small">Yes, I do.=C2=A0 </div><blockquote class=3D"gmail=
_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204=
,204);padding-left:1ex">
<br><br>
On the issue, I suggested de-serializing the original rather than <br>
recompiling.<br></blockquote><div><br></div><div><div class=3D"gmail_defaul=
t" style=3D"font-family:arial,helvetica,sans-serif;font-size:small">It woul=
d make sense, if I knew how to access the information</div><div class=3D"gm=
ail_default" style=3D"font-family:arial,helvetica,sans-serif;font-size:smal=
l">using rpc. For SyntaxErrors and subclasses, all I need for the<br></div>=
<div class=3D"gmail_default" style=3D"font-family:arial,helvetica,sans-seri=
f;font-size:small">analysis are the Exception argument (message, offset, li=
neno, etc.)</div><div class=3D"gmail_default" style=3D"font-family:arial,he=
lvetica,sans-serif;font-size:small">and the entire offending code.</div><di=
v class=3D"gmail_default" style=3D"font-family:arial,helvetica,sans-serif;f=
ont-size:small"><br></div><div class=3D"gmail_default" style=3D"font-family=
:arial,helvetica,sans-serif;font-size:small"><br></div><div class=3D"gmail_=
default" style=3D"font-family:arial,helvetica,sans-serif;font-size:small">A=
ndr=C3=A9</div></div></div></div>

--00000000000094272505c52efa5e--

--===============3967461141507352233==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
IDLE-dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/idle-dev

--===============3967461141507352233==--