Gabriele Monaco <[email protected]> writes:
> +            if any(u in self.env_types.values() for u in ["ns", "us", "ms", 
> "s"]):
> +                buff.append("#define HA_CLK_NS")

That any() twisted my brain. Does the following work?

    if not {"ns", "us", "ms", "s"}.isdisjoint(self.env_types.values())

> +        match unit:
> +            case "us":
> +                value *= 1000
> +            case "ms":
> +                value *= 1000000
> +            case "s":
> +                value *= 1000000000

Use 10**9 instead, so that we don't have to count the zeroes.

Nam

Reply via email to