[Python-Dev] 2.5 status

Brett Cannon brett at python.org
Tue Sep 5 21:41:49 CEST 2006


On 9/5/06, M.-A. Lemburg <mal at egenix.com> wrote:
>
> Brett Cannon wrote:
> > On 9/4/06, Neal Norwitz <nnorwitz at gmail.com> wrote:
> >>
> >> There are 3 bugs currently listed in PEP 356 as blocking:
> >>         http://python.org/sf/1551432 - __unicode__ breaks on exception
> >> classes
> >
> >
> > I replied on the bug report, but might as well comment here.
> >
> > The problem with this bug is that BaseException now defines a
> __unicode__()
> > method in its PyMethodDef.  That intercepts the unicode() call on the
> class
> > and it complains it was not handed an instance.  I guess the only way to
> > fix this is to toss out the __unicode__() method and change the tp_str
> function
> > to return Unicode as needed (unless someone else has a better idea).  Or
> > the bug can be closed as Won't Fix.
>
> The proper fix would be to introduce a tp_unicode slot and let
> this decide what to do, ie. call .__unicode__() methods on instances
> and use the .__name__ on classes.


That was my bug reaction  and what I said on the bug report.  Kind of
surprised one doesn't already exist.

I think this would be the right way to go for Python 2.6. For
> Python 2.5, just dropping this .__unicode__ method on exceptions
> is probably the right thing to do.


Neal, do you want to rip it out or should I?

-Brett
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/python-dev/attachments/20060905/f0862cc8/attachment.htm 


More information about the Python-Dev mailing list