[Python-Dev] PEP 246, redux (original) (raw)

Phillip J. Eby pje at telecommunity.com
Mon Jan 10 23:19:02 CET 2005


At 02:27 PM 1/10/05 -0500, Clark C. Evans wrote:

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? :)



More information about the Python-Dev mailing list