This example from the docs for |attr does not appear to be working in Craft 3.5:
{% set tag = '<div class="foo">' %}
{{ tag|attr({class: false})|attr({class: 'bar'}) }}
{# Output: <div class="bar"> #}
Actual output: <div class="foo bar">
Thanks for pointing that out! Just fixed this for the next release.
Craft 3.5.17 is out now with this fix.