Re: ObjectWrapper subclasses always callable

Marcin Tustin <[email protected]> Wed, 23 May 2012 16:25:12 +0100
Newsgroups gmane.comp.python.peak
Message-ID <CAJTzQMDUa6iODinetsBMx78h9fcBsnH_DwtJSQkcQ=4Of7SWeg@mail.gmail.com>
--===============1044899526==
Content-Type: multipart/alternative; boundary=f46d043bd6faca28a904c0b5bda8

--f46d043bd6faca28a904c0b5bda8
Content-Type: text/plain; charset=ISO-8859-1

Python 2.7.2

On Wed, May 23, 2012 at 4:23 PM, PJ Eby <pje-Wh6+Hckhi6HFNGf7iClzIwC/[email protected]> wrote:

>
> On May 23, 2012 10:39 AM, "Marcin Tustin" <[email protected]> wrote:
> >
> > I've found that instances of ObjectWrapper (and any subclasses) are
> always callable (the callable function returns True), notwithstanding that
> the __subject__ is not callable. Is there a way to remedy this?
> >
> > I've tried deleting the __call__ method, creating empty slots, creating
> my own call method, then trying to delete, using del or delattr on the
> subclass object, and creating a custom __getattribute__, all to no avail.
>
> Which Python version are you using?
>



-- 
Marcin Tustin
Tel: 07773 787 105

--f46d043bd6faca28a904c0b5bda8
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Python 2.7.2<br><br><div class=3D"gmail_quote">On Wed, May 23, 2012 at 4:23=
 PM, PJ Eby <span dir=3D"ltr">&lt;<a href=3D"mailto:pje-Wh6+Hckhi6HFNGf7iClzIwC/[email protected]" =
target=3D"_blank">pje-Wh6+Hckhi6HFNGf7iClzIwC/[email protected]</a>&gt;</span> wrote:<br><blockquot=
e class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc sol=
id;padding-left:1ex">
<div class=3D"im"><p><br>
On May 23, 2012 10:39 AM, &quot;Marcin Tustin&quot; &lt;<a href=3D"mailto:m=
[email protected]" target=3D"_blank">[email protected]</a>&gt; w=
rote:<br>
&gt;<br>
&gt; I&#39;ve found that instances of ObjectWrapper (and any subclasses) ar=
e always callable (the callable function returns True), notwithstanding tha=
t the __subject__ is not callable. Is there a way to remedy this?<br>
&gt;<br>
&gt; I&#39;ve tried deleting the __call__ method, creating empty slots, cre=
ating my own call method, then trying to delete, using del or delattr on th=
e subclass object, and creating a custom __getattribute__, all to no avail.=
=A0</p>


</div><p>Which Python version are you using?</p>
</blockquote></div><br><br clear=3D"all"><div><br></div>-- <br>Marcin Tusti=
n<br>Tel: 07773 787 105<br><br>

--f46d043bd6faca28a904c0b5bda8--

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

_______________________________________________
PEAK mailing list
[email protected]
http://www.eby-sarna.com/mailman/listinfo/peak
--===============1044899526==--