On 9. Sep., 12:31 h., Tim Northover <t.p.northo...@sms.ed.ac.uk>
wrote:
> gentlestone <tibor.b...@hotmail.com> writes:
> >  return u"{}".format(self.name)
>
> > this one doesn't work on unicode strings. I there a not old formatting
> > style possibilty for unicode strings?
>
> It looks like you're trying to mix python 3.1 and 2.6. In 2.6 you have
> to put a number inside the {} to tell it which argument to use. In 3.1
> all strings are unicode.
>
> Apparently when 2.7 is released it will backport the empty {} feature
> from 3.1. Until then
>
> return u'{0}'.format(self.name)
>
> is what you should probably use.
>
> Tim.

I have python 2.5

return u'{0}'.format(self.name)

doesn't work eigther

the error message i've got is:

'unicode' object has no attribute 'format'

is the new formatting style newer then python 2.5?

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to