For example, strings "mean" very different concepts in various contexts, e.g. a file name, an url, the byte content a document, or the pickled representation of something.
Note that this is solvable in practice by the author of a method or framework choosing to define an interface that they accept, and then pre-defining the adaptation from string to that interface. So, what a string "means" in that context is pre-defined.
The interpretation problem for strings comes only when a third party attempts to define adaptation from a string to a context that takes some more generic interface.
This would allow a module to provide the str->StringIO or str->file conversion locally.
It also works for the module to define a target interface and register an adapter to that, and introduces less complexity into the adaptation system.
_______________________________________________ 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