Re: f-string error message

2023-08-30 Thread Random832 via Python-list
On Sun, Aug 27, 2023, at 17:19, Rob Cliffe via Python-list wrote: > I understand that this is an error: I'm telling the f-string to expect > an integer when in fact I'm giving it a Decimal. > And indeed f"{x:3}" gives ' 42' whether x is an int or a Decimal. > However, to my mind it is not the

f-string error message

2023-08-30 Thread Rob Cliffe via Python-list
I am currently using Python 3.11.4. First I want to say: f-strings are great!  I use them all the time, mostly but by no means exclusively for debug messages.  And in 3.12 they will get even better. And the improved error messages in Python (since 3.9) are great too!  Keep up the good work.

Re: Using "textwrap" package for unwrappable languages (Japanese)

2023-08-30 Thread Peter J. Holzer via Python-list
On 2023-08-30 13:18:25 +, c.buhtz--- via Python-list wrote: > Am 30.08.2023 14:07 schrieb Peter J. Holzer via Python-list: > > another caveat: Japanese characters are usually double-width. So > > (unless your line length is 130 characters for English) you would > > want to add that line break

Re: Using "textwrap" package for unwrappable languages (Japanese)

2023-08-30 Thread c.buhtz--- via Python-list
Dear Peter, thanks for your reply. That is a very interesting topic. I was a bit wrong. I realized that textwrap.wrap() do insert linebreaks when "words" are to long. So even a string without any blank space well get wrapped. Am 30.08.2023 14:07 schrieb Peter J. Holzer via Python-list:

Re: Using "textwrap" package for unwrappable languages (Japanese)

2023-08-30 Thread Peter J. Holzer via Python-list
On 2023-08-30 11:32:02 +, c.buhtz--- via Python-list wrote: > I do use "textwrap" package to wrap longer texts passages. Works well with > English. > But the source string used is translated via gettext before it is wrapped. > > Using languages like Japanese or Chinese would IMHO result in

Using "textwrap" package for unwrappable languages (Japanese)

2023-08-30 Thread c.buhtz--- via Python-list
Hi, I do use "textwrap" package to wrap longer texts passages. Works well with English. But the source string used is translated via gettext before it is wrapped. Using languages like Japanese or Chinese would IMHO result in unwrapped text. Japanese rules do allow to break a line nearly