Tim Peters wrote: > > ... > > -1. User input is never trustworthy. Your and your users' software lives > will be a lot happier if you stick to the rule that an assertion failure > always (always!) announces a bug in the implementation -- assertion failure > is never a user's fault. So you prefer if __debug__ and node.nodeType!=ELEMENT_TYPE: raise TypeError Unfortunately there's no way to turn that off at "compile time" so you always incur the __debug__ lookup cost. That would send us back to two versions of the methods. Maybe testing would indicate that the performance implications are minor. If so, I wouldn't mind having the type checks in there. Paul Prescod
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