[Python-Dev] PEP 246: lossless and stateless

Just van Rossum just at letterror.com
Fri Jan 14 18:56:52 CET 2005


Phillip J. Eby wrote:

> For example, if there were a weak reference dictionary mapping
> objects to their (stateful) adapters, then adapt() could always
> return the same adapter instance for a given source object, thus
> guaranteeing a single state.

Wouldn't that tie the lifetime of the adapter object to that of the
source object?

Possibly naive question: is using adaptation to go from iterable to
iterator abuse? That would be a clear example of per-adapter state.

Just


More information about the Python-Dev mailing list