Войти в систему

Home
    - Создать дневник
    - Написать в дневник
       - Подробный режим

LJ.Rossia.org
    - Новости сайта
    - Общие настройки
    - Sitemap
    - Оплата
    - ljr-fif

Редактировать...
    - Настройки
    - Список друзей
    - Дневник
    - Картинки
    - Пароль
    - Вид дневника

Сообщества

Настроить S2

Помощь
    - Забыли пароль?
    - FAQ
    - Тех. поддержка



Пишет LWN.net ([info]syn_lwnheadline)
@ 2020-04-01 22:43:00


Previous Entry  Add to memories!  Tell a Friend!  Next Entry
[$] Reworking StringIO concatenation in Python
Python string objects are immutable, so changing the value of a string
requires that a new string object be created with the new value. That is
fairly well-understood within the community, but there are some
"anti-patterns" that arise; it is pretty common for new users to build up a
longer string by repeatedly concatenating to the end of the "same" string.
The performance penalty for doing that could be avoided by switching to a
type that is geared toward incremental updates, but Python 3 has
already optimized the penalty away for regular strings. A recent thread on the python-ideas
mailing list explored this topic some.


(Читать комментарии) (Добавить комментарий)