On Thu, Jan 13, 2005 at 08:08:43PM -0500, Bob Ippolito wrote: | >Ok. I think we have identified two sorts of restrictions on the | >sorts of adaptations one may want to have: | > | > `stateless' the adaptation may only provide a result which | > does not maintain its own state | > | > `lossless' the adaptation preserves all information available | > in the original object, it may not discard state | > | >If we determined that these were the 'big-ones', we could possibly | >allow for the signature of the adapt request to be parameterized with | >these two designations, with the default to accept any sort of adapter: | > | > adapt(object, protocol, alternative = None, | > stateless = False, lossless = False) | > | >Then, Guido's 'Optional Static Typing', | > | > def f(X: Y): | > pass | > | > would be equivalent to | > | > def f(X): | > X = adapt(X,Y, stateless = True, lossless = True) .. | | In some cases, such as when you plan to consume the whole thing in one | function call, you wouldn't care so much if it's stateless.
etrepum, True False stateless adapter may not add adapter may have its state beyond that already own state, if it wishes provided by the object but additional state is not required lossless adapter must preserve and adapter may discard give all information which information if it wishes the underlying object has So, in this case, if your consumer doesn't care if the adapter is stateless or not, just call adapt(), which defaults to the case that you wish. Is this a better explanation? Or is this whole idea too convoluted? Best, Clark _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com