Message from discussion
Patches: noerror option to code_assist
Received: by 10.50.100.168 with SMTP id ez8mr220048igb.1.1346374201639;
Thu, 30 Aug 2012 17:50:01 -0700 (PDT)
X-BeenThere: rope-dev@googlegroups.com
Received: by 10.50.104.169 with SMTP id gf9ls1781970igb.0.gmail; Thu, 30 Aug
2012 17:50:01 -0700 (PDT)
Received: by 10.50.159.137 with SMTP id xc9mr216056igb.3.1346374201160;
Thu, 30 Aug 2012 17:50:01 -0700 (PDT)
Received: by 10.50.159.137 with SMTP id xc9mr216054igb.3.1346374201143;
Thu, 30 Aug 2012 17:50:01 -0700 (PDT)
Return-Path: <anton.belogla...@gmail.com>
Received: from mail-ie0-f182.google.com (mail-ie0-f182.google.com [209.85.223.182])
by gmr-mx.google.com with ESMTPS id dd6si758862igc.0.2012.08.30.17.50.01
(version=TLSv1/SSLv3 cipher=OTHER);
Thu, 30 Aug 2012 17:50:01 -0700 (PDT)
Received-SPF: pass (google.com: domain of anton.belogla...@gmail.com designates 209.85.223.182 as permitted sender) client-ip=209.85.223.182;
Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of anton.belogla...@gmail.com designates 209.85.223.182 as permitted sender) smtp.mail=anton.belogla...@gmail.com; dkim=pass header...@gmail.com
Received: by mail-ie0-f182.google.com with SMTP id c12so2092902ieb.27
for <rope-dev@googlegroups.com>; Thu, 30 Aug 2012 17:50:01 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=20120113;
h=mime-version:in-reply-to:references:from:date:message-id:subject:to
:cc:content-type;
bh=K2tMUYHV8kNJRShctC4R+HT4+wE7RVPwhpVzrJyQ45Y=;
b=WIBjTWeUSRD2msOqPtIPQ6OMpN/FzDwaFduKKpCqAHLoJAdHSC2WA8Kiz4DEtySrdE
YBZq+PJFbEuAvE5phPCSEvJGQM5yqQvakU/Gr2fdgw8F30vB/Uy17yCAgYTK609Ks43z
dwf2ldKA6NrjGSPN3d0FthJuhfqikJc6UAeijbbUmsJIa7qZlJzlLM+d/BPzwqvGTLoh
ld1kuyppINc7EQq7FtQmIm3tSN/M3NVjxedcPmDOeSz7kNAbOuYteMU07NRiG612SNHO
qhVvM8G2X2F4DIqw4UScq+LuHVIfXUAa60Ij6ZdAfQE2v/2v35ad0QkuHHZ2khb6Z7wq
zwDw==
Received: by 10.50.188.129 with SMTP id ga1mr326114igc.6.1346374201022; Thu,
30 Aug 2012 17:50:01 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.64.145.1 with HTTP; Thu, 30 Aug 2012 17:49:20 -0700 (PDT)
In-Reply-To: <20123008181...@lilem.mirepesht>
References: <CAPM+gBR2Dv1Pf+FGyWMRo_+d4qwoM5X_ZXW2+t_CAU--mSK...@mail.gmail.com>
<20122303154...@lilem.mirepesht> <CAPM+gBRVvd=Wg=xPSb_vuMG8oOfW9DSCPyj4sP0Nkyx=NLu...@mail.gmail.com>
<20122403092...@lilem.mirepesht> <CAPM+gBTj5aRJiASsvBhkQFLGyT0DYb4B57z1_34xGg=uMvn...@mail.gmail.com>
<20122403165...@lilem.mirepesht> <CAPM+gBTx9Hi+q=XbLnfhRHGLLbsTSw=hnzUdtmXz=Eja1mg...@mail.gmail.com>
<20122503000...@lilem.mirepesht> <CAPM+gBQTVjj9doWxFKsvZTxjG+3zJ68fAy4=pyzabr0RUVM...@mail.gmail.com>
<20122503080...@lilem.mirepesht> <20122503083...@lilem.mirepesht>
<CAPM+gBRvBVA+yxVr5juaLSom9KmtHhQkjatuCc39echPJ7c...@mail.gmail.com>
<CAPM+gBTUZTd8Z5rANj6LG+bo--x9Rg8=yyV73s03DU1WXRM...@mail.gmail.com>
<20122503154...@lilem.mirepesht> <m1vclshjar....@gmail.com>
<CAPM+gBQhi1-zVHyJPgin4G95HZN0ni+q3hE=udc6Df0Yg7R...@mail.gmail.com>
<20122603000...@lilem.mirepesht> <0d811a66-bc49-4a24-8aa9-8d3a0b399b7a@googlegroups.com>
<20122308182...@lilem.mirepesht> <m1y5l541mv....@gmail.com>
<11e60759-f3d8-4b11-90a8-fb7ab306586f@googlegroups.com> <20122408063...@lilem.mirepesht>
<CAHVUVS7pvm_wxOKEt=k7UV9UAt4SLzJ1GGY8ujj_7dfT=TN...@mail.gmail.com>
<20122708193...@lilem.mirepesht> <CAHVUVS6RtFS3YVi7heNuwB7Xg988Beet-sZYHTEYqf90VzA...@mail.gmail.com>
<CAHVUVS5fivWPvhDE-jP70qi9wyV6hHR6aUw2+f51REgjn2s...@mail.gmail.com>
<CAHVUVS5TonWQRChr2RKfF_4ythesCiCj8sNuMBF8Eif=BHa...@mail.gmail.com>
<20122808174...@lilem.mirepesht> <CAHVUVS63upxf28oCE+8NnO014VhHBBB7Z--LNEPcKdzeZHe...@mail.gmail.com>
<20122908141...@lilem.mirepesht> <CAKmrg8ObUP=Aw6LK=_uSfEdBs3meRc951fA4dG8FrHT5mLE...@mail.gmail.com>
<CAHVUVS4fC+eLHcyTS7P_0kT_w9mk3Rw5UZ4nXYW5eF7XzeW...@mail.gmail.com> <20123008181...@lilem.mirepesht>
From: Anton Beloglazov <anton.belogla...@gmail.com>
Date: Fri, 31 Aug 2012 10:49:20 +1000
Message-ID: <CAHVUVS6=EGq+U_axGbaOkugconrRAiRPLDOLdDnPb6bpsco...@mail.gmail.com>
Subject: Re: Patches: noerror option to code_assist
To: Ali Gholami Rudi <aligr...@gmail.com>
Cc: an...@angri.ru, rope-dev@googlegroups.com
Content-Type: multipart/alternative; boundary=14dae93407f7fc984a04c8852bd4
--14dae93407f7fc984a04c8852bd4
Content-Type: text/plain; charset=ISO-8859-1
Hi Ali,
Thanks for the explanation! In my opinion, the two parameter approach is
easier to understand since it's more explicit and doesn't require any
special values.
Thanks,
Anton
On Fri, Aug 31, 2012 at 12:22 AM, Ali Gholami Rudi <aligr...@gmail.com>wrote:
> Hi Anton,
>
> Anton Beloglazov <anton.belogla...@gmail.com> wrote:
> > Regarding the "return on error" behavior, that is the implementation
> > proposed by Ali, I've just adopted it. Perhaps, Ali could explain his
> > choice of a singleton object over a boolean variable. To me, it seems
> that
> > a boolean parameter would work just as well.
>
> Actually the error_return parameter is the value to return on errors.
> I added a similar parameter to local_command() mainly for implementing
> local_function(). But then to retain the old behavior, I needed
> to somehow tell local_command() to re-raise an exception instead of
> returning a value. I could have added a new boolean parameter like
> reraise_exceptions, which, when False, forced the value of the new
> error_return parameter to be returned. This would have required adding
> two new parameters to local_command(), one of which was dependent
> on the other; i.e. error_return would have been meaningful only if
> reraise_exceptions was False.
>
> I decided to merge the arguments: when exceptions are caught, the value
> passed as error_return should be returned, unless it is log_errors (maybe
> reraise_errors is a better name). I added the log_errors singleton
> because I couldn't tell if any other value (like None) is meant to
> be returned on errors or is meant to request re-raising exceptions.
> I thought this is the common practice in such cases, but maybe I'm among
> the few who used to use this technique (or hack, probably).
>
> I suggest either adding comments for this new parameter and the new
> global variable or using the double parameter approach. Unless, of
> course, someone has a cleaner solution.
>
> Thanks,
> Ali
>
>
--14dae93407f7fc984a04c8852bd4
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Hi Ali,<div><br></div><div>Thanks for the explanation! In my opinion, the t=
wo parameter approach is easier to understand=A0since it's=A0more expli=
cit and=A0doesn't require any special values.</div><div><br></div><div>=
Thanks,</div>
<div>Anton</div><div><br><div class=3D"gmail_quote">On Fri, Aug 31, 2012 at=
12:22 AM, Ali Gholami Rudi <span dir=3D"ltr"><<a href=3D"mailto:aligrud=
i...@gmail.com" target=3D"_blank">aligr...@gmail.com</a>></span> wrote:<br>=
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex">
<div class=3D"im">Hi Anton,<br>
<br>
Anton Beloglazov <<a href=3D"mailto:anton.belogla...@gmail.com">anton.be=
logla...@gmail.com</a>> wrote:<br>
</div><div class=3D"im">> Regarding the "return on error" beha=
vior, that is the implementation<br>
> proposed by Ali, I've just adopted it. Perhaps, Ali could explain =
his<br>
> choice of a singleton object over a boolean variable. To me, it seems =
that<br>
> a boolean parameter would work just as well.<br>
<br>
</div>Actually the error_return parameter is the value to return on errors.=
<br>
I added a similar parameter to local_command() mainly for implementing<br>
local_function(). =A0But then to retain the old behavior, I needed<br>
to somehow tell local_command() to re-raise an exception instead of<br>
returning a value. =A0I could have added a new boolean parameter like<br>
reraise_exceptions, which, when False, forced the value of the new<br>
error_return parameter to be returned. =A0This would have required adding<b=
r>
two new parameters to local_command(), one of which was dependent<br>
on the other; i.e. error_return would have been meaningful only if<br>
reraise_exceptions was False.<br>
<br>
I decided to merge the arguments: when exceptions are caught, the value<br>
passed as error_return should be returned, unless it is log_errors (maybe<b=
r>
reraise_errors is a better name). =A0I added the log_errors singleton<br>
because I couldn't tell if any other value (like None) is meant to<br>
be returned on errors or is meant to request re-raising exceptions.<br>
I thought this is the common practice in such cases, but maybe I'm amon=
g<br>
the few who used to use this technique (or hack, probably).<br>
<br>
I suggest either adding comments for this new parameter and the new<br>
global variable or using the double parameter approach. =A0Unless, of<br>
course, someone has a cleaner solution.<br>
<br>
Thanks,<br>
Ali<br>
<br>
</blockquote></div><br></div>
--14dae93407f7fc984a04c8852bd4--