gentlestone wrote:
> the error message i've got is:
>
> 'unicode' object has no attribute 'format'
>
> is the new formatting style newer then python 2.5?
>
>
Have you tried reading the documentation? It generally tells you which
version of Python introduced a feature:
http://docs.python.org
On 9 Sep, 12:49, gentlestone wrote:
>
> 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?
Yes. The new string formatting appeared i
On 9. Sep., 12:31 h., Tim Northover
wrote:
> gentlestone 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
>
gentlestone schrieb:
return u"{}".format(self.name)
u"{0}".format(u"blah")
works for me with python-2.6.2
Maybe your format string is wrong.
- Patrick
--
http://mail.python.org/mailman/listinfo/python-list
gentlestone 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
return u"{}".format(self.name)
this one doesn't work on unicode strings. I there a not old formatting
style possibilty for unicode strings?
Note: self.name can be unicode string!
--
http://mail.python.org/mailman/listinfo/python-list