Carlos Ribeiro wrote:
On Thu, 13 Jan 2005 10:08:10 -0500, Phillip J. Eby
<[EMAIL PROTECTED]> wrote:

With the previous PEP, people could create all sorts of subtle problems in
their code (with or without transitivity!) and have no direct indicator of
a problem.  Clark and Ian made me realize this with their string/file/path
discussions -- *nobody* is safe from implicit adaptation if adaptation
actually creates new objects with independent state!  An adapter's state
needs to be kept with the original object, or not at all, and most of the
time "not at all" is the correct answer.


+1, specially for the last sentence. An adapter with local state is
not an adapter anymore! It's funny how difficult it's to get this...
but it's obvious once stated.

+lots

Now that it's been stated, I think this is similar to where implicit type conversions in C++ go wrong, and to the extent that PEP 246 aligns with those. . . *shudder*.

I've also learned from this discussion just how wrong my own ideas about how to safely use adaptation were. Most Python programmers aren't going to have the benefit of listening to some smart people work through the various issues in public.

Cheers,
Nick.

--
Nick Coghlan   |   [EMAIL PROTECTED]   |   Brisbane, Australia
---------------------------------------------------------------
            http://boredomandlaziness.skystorm.net
_______________________________________________
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

Reply via email to