If this proposal was "packaged" with an "interface" mechanism, would this address your concern? In this scenerio, there are two cases:
- Older classes will most likely not have a __conform__ method. - Newer classes will use the 'interface' mechanism.
In this scenerio, there isn't a performance penalty for the usual case; and for migration purposes, a flag could be added to disable the checking.
As I said, after more thought, I'm actually less concerned about the performance than I am about even remotely encouraging the combination of Liskov violation *and* concrete adaptation targets. But, if "after the dust settles" it turns out this is going to be supported after all, then we can worry about the performance if need be.
Note, however, that your statements actually support the idea of *not* adding a special case for Liskov violators. If newer code uses interfaces, the Liskov-violation mechanism is useless. If older code doesn't have __conform__, it cannot possibly *use* the Liskov-violation mechanism.
So, if neither old code nor new code will use the mechanism, why have it? :)
_______________________________________________ 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