checking method? return values
"Mark Hahn" <[email protected]>
| Newsgroups | gmane.comp.lang.prothon.user |
|---|---|
| Message-ID | <[email protected]> |
Someone on comp.lang.python pointed out that we could enforce the method contract implied by "question" methods whose names end with a question mark if we wanted to. We could check all return values to make sure they were either True or False. The overhead would be a small amount at compile time and two compare instructions at run time only for question methods. There would be no prototype lookup or anything expensive, just two direct compares. Comments? Votes?