Patrick Maupin wrote: > 1) What is the best thing to do right now for PEP3101? > > 2) If the "right now" answer isn't very good, is this really a more > general problem that needs work? As more "little languages" do things > like manipulate the AST, it might become very useful to have the > ability to place almost arbitrary objects on the traceback stack.
Off the top of my head (without thinking about it too deeply) the way I would approach it is to catch the exception inside the string formatting function, wrap it in another exception that has additional information about where in the formatting string the error occurred, and then re-raise that second exception, using the traceback provided from the first exception. So for example, at the application level, you might get an exception with a message such as: "Error in format string, line 2, character 7: Argument Exception" -- Talin _______________________________________________ Python-3000 mailing list Python-3000@python.org http://mail.python.org/mailman/listinfo/python-3000 Unsubscribe: http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com