[Reality] Containment - barriers to implementation
Christopher Armstrong
radix at twistedmatrix.com
Sat Apr 3 23:56:58 MST 2004
exarkun at divmod.com wrote:
> class Look(TargetAction):
> def doAction(self):
> ....
> if usingXRayVision:
> c = collect(self.target, IDescribable,
> # Only implementors that are lead can actually be seen
> lambda o: IMaterial(o).type == 'lead',
> # Only collectors that are lead cannot be seen through
> lambda o: IMaterial(o).type != 'lead',
> 2)
> else:
> c = collect(self.target, IDescribable,
> # All implementors are visible
> lambda o: True,
> # Open and transparent containers can be seen through
> lambda o: not ICloseable(o).closed or IMaterial(o).type == 'glass'
> 2)
Hmm, the last bit kinda annoys me. Maybe we should allow the collectors
to implement some of those 'blocking' semantics themselves ("Am I
closed? If so, don't let things through") with the option for the
criterion to override them?
--
Twisted | Christopher Armstrong: International Man of Twistery
Radix | Release Manager, Twisted Project
---------+ http://radix.twistedmatrix.com/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 256 bytes
Desc: OpenPGP digital signature
Url : http://pyramid.twistedmatrix.com/pipermail/reality/attachments/20040404/20d7dce1/signature.bin
More information about the Reality
mailing list