В PEP634..6 убегают они или нет — вроде как вообще неопределённое поведение
> It binds the subject value to the name using the scoping rules for name binding established for the walrus operator Читаем "о места связывания и ниже"
> It binds the subject value to the name using the scoping rules for name binding established for the walrus operator Читаем "о места связывания и ниже"
PEP 634, Side Effects and Undefined Behavior: Another undefined behavior is the binding of variables by capture patterns that are followed (in the same case block) by another pattern that fails. These may happen earlier or later depending on the implementation strategy, the only constraint being that capture variables must be set before guards that use them explicitly are evaluated.
PEP 634, Side Effects and Undefined Behavior: Another undefined behavior is the binding of variables by capture patterns that are followed (in the same case block) by another pattern that fails. These may happen earlier or later depending on the implementation strategy, the only constraint being that capture variables must be set before guards that use them explicitly are evaluated.
Это понятно, по скоупу переменная переживает match, но будет ли она фактически создана — знать заранее нельзя. Тут ровно то же, что и с "моржом"
у какие у нас есть spine-strict структуры с максимально дешевым (<>)?
у меня есть обход большого дерева (сотни тысяч элементов) с IO. Результат в каждом листе — Semigroup, общий результат — mconcat их всех. Сейчас у меня [], попробовал Set (уникальность не важна, можно в конце сделать distinct), но Set ощутимо жирнее по памяти. Что там еще, Seq?