[Divunal-author] verbs and components

Allen Short washort@twistedmatrix.com
Thu, 12 Sep 2002 17:34:46 -0500 (CDT)


----Security_Multipart(Thu_Sep_12_17:34:47_2002_230)--
Content-Type: Text/Plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

>>>>> "Glyph" == Glyph Lefkowitz <glyph@twistedmatrix.com> writes:

    > A question asked on IRC that I missed:

    >> <dash> glyph: think an IThing interface is ok, so's we can have
    >> actions that work on anything?

    > Well, this line from simple.py answers the question, really:

    >     registerAdapter(Inedible, Thing, IEatTarget)

    > if you register an adapter for Thing, then it's the adapter you
    > get back 90% of the time.  If you want an action to work on
    > anything, the default response to the action should be factored
    > like this, I think.  Is there a case where you wouldn't want it
    > to be?

well, my thought was that containment-oriented verbs (get, put, etc.)
should accept any Thing as their target. I guess one could register an
adapter like that, it just didn't seem to be the right way to do
it. Are you recommending "registerAdapter(Thing, Thing, ITakeTarget)"? 
Of course, the _current_ way i'm doing it with "take" is obviously
wrong, now:

Thing.__implements__ += (ITakeTarget,)

----Security_Multipart(Thu_Sep_12_17:34:47_2002_230)--
Content-Type: application/pgp-signature
Content-Transfer-Encoding: 7bit

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQA9gRaHEd6n5DRBYM4RAkYiAJ4iu76IV9vbhLp9fE2K8TD6BGfLPgCgkVCE
nrSc1Qh9A2zGZbwa08xIY3s=
=r0d9
-----END PGP SIGNATURE-----

----Security_Multipart(Thu_Sep_12_17:34:47_2002_230)----