At 02:03 PM 1/12/05 -0600, Skip Montanaro wrote: >I don't think that's appropriate in this case. Liskov violation is >something precise. I don't think that changing what you call it will help >beginners understand it any better in this case. I say leave it as it and >make sure it's properly documented. Actually, the whole discussion is kind of backwards; you should never *get* a Liskov violation error, because it's raised strictly for control flow inside of __conform__ and caught by adapt(). So the *only* way you can see this error is if you call __conform__ directly, and somebody added code like this: raise LiskovViolation So, it's not something you need to worry about a newbie seeing. The *real* problem with the name is knowing that you need to use it in the first place! IMO, it's simpler to handle this use case by letting __conform__ return None, since this allows people to follow the One Obvious Way to not conform to a particular protocol. Then, there isn't a need to even worry about the exception name in the first place, either...
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4