> 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
+1 on having a provision for adapters to provide some meta-information about themselves. With these two key properties identified at the outset, adapt calls can be made a bit more intelligent (or at least less prone to weirdness). There is some merit to establishing these properties right away rather than trying to retrofit adapters after they've been in the wild for a while. > Since __conform__ and __adapt__ > would sprout two new arguments, it would make those writing adapters > think a bit more about the kind of adapter that they are providing. Using optional arguments may not be the most elegant or extensible approach. Perhaps a registry table or adapter attributes would fare better. Raymond Hettinger _______________________________________________ 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