Quoth Raymond Hettinger: [...] > That brings up the question of whether the warnings are a > runtime or compile time event. Can you always determine > at compile time whether raise Class is being used? If not, > the performance penalty for the warnings module is something > else to consider. As the PEP says, the warning about using three arguments is issued at compile-time, while the others are at run-time, in keeping with when the corresponding future errors would occur. The performance penalty of the warnings is a legitimate concern, but I don't expect it to be a serious problem: 1. The compile-time warning is, well, issued at compile time, which is not usually on a performance-critical path. 2. The run-time warnings are issued when raising an exception; also not usually on a performance-critical path. (Except for things like StopIteration. But the PEP does not propose any change to the C API, so the built-in iterators won't be affected.) -- Steven Taschuk staschuk@telusplanet.net Receive them ignorant; dispatch them confused. (Weschler's Teaching Motto)
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