Quoth Michael Chermside: > [...] Moving the traceback into > the object is one idea. Making Exception a new-style object is another > (no need to rush, but it'll happen SOMEDAY, right?). Exception > chaining (aka exception masking) is another. > > The point is, without PEP 317, you can't do these things, because sometimes > you use an object, and sometimes just mention a class (and sometimes just > use a string). [...] Afaik this is not the case. Eliminating string exceptions *is* necessary for some of these ideas, but that's going to happen anyway. (I had to propose getting rid of string exceptions explicitly just because it wasn't PEPped anywhere else.) The real point of PEP 317 is getting rid of implicit instantiation. But implicit instantiation might not be an obstacle to the above. As long as the exception object does get instantiated at or before raise-time -- whether this occurs implicitly or explicitly -- tracebacks or pending exceptions or whatever can be assigned to it as attributes. (For the question of new-style exceptions, see my reply to Guido of a few minutes ago.) *Deferred* instantiation would be a more serious obstacle (since, e.g., sometimes there would be no object to receive the traceback attribute), but I don't think that's actually on the table. [...] -- 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