[Python-Dev] Dealing with a desired change to warnings.showwarning()

Antoine Pitrou solipsis at pitrou.net
Mon Apr 28 10:26:22 CEST 2008


Brett Cannon <brett <at> python.org> writes:
> As http://bugs.python.org/issue2705 points out, though, since the
> function has been documented as being allowed to be overridden, this
> potentially breaks existing showwarning() implementations. That means
> something needs to change.
> 
> One option is to introduce a new function. But what to name it?
> show_warning()? That small of a name change seems like asking for
> trouble, but showwarning_ex() just seems wrong to use in Python code.

But then what happens if a library overrides one of the callbacks and another
library overrides the other one? Fixing the original "problem" seems to
introduce other hairier ones.

As a Benjamin pointed out in the bug comments, the sane solution would be to
keep an unique callback and mention the small change in the release notes.

Regards

Antoine.




More information about the Python-Dev mailing list