Backs off on each failure and spreads retries out, so a recovering service is not hit by every client at once.
Tag
Snippets tagged c
itertools.batched on 3.12 and later; the islice version works everywhere and never materialises the whole input.
__post_init__ runs after the generated constructor, which is where cheap invariants belong.
A context manager that prints how long its body took, without scattering time.perf_counter calls through the function.
argparse covers subcommands, types and help text, which is more than most scripts ever need.
The | operator returns a new dict; |= updates in place. Later keys win in both.
Assigning to never makes the compiler fail the build when a new union member is added and left unhandled.
`as const` keeps the literal types, so the derived union is the actual keys rather than string.
Grid is one line. Flex is three and gives you control over the axes separately.
Ellipsis after two lines. The -webkit- prefixes are still required despite being supported everywhere.
One rule that disables animation for people who asked their system for less of it.
Hides a label from sight while leaving it in the accessibility tree. display:none would remove it from both.