You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
arc/level.py:152 (__str__): all([val for val in self.args.values()]) — requires both slots to be populated.
Consequence: a keyword-only level (the common case, e.g. args={'keyword': {'opt': 'opt=(verytight)'}}) serialises its args correctly but stays silent about them in its string representation, so the args are invisible in logs and in anything that renders a level via str().
This is cosmetic — it affects log/repr text only, not the round-trip or job args — but the divergence is a trap for the next reader.
Suggested fix: extract one named helper (e.g. Level.has_args() -> bool) returning bool(self.args) and any(v for v in self.args.values()), and call it from both sites. A unit test asserting that a keyword-only level shows its keyword args in str(level) would pin the behaviour.
Follow-up to #963, which was deliberately scoped to the
as_dict()round-trip.Levelnow answers the same question two different ways:arc/level.py:200(as_dict):any(v for v in self.args.values())— retainsargswhen at least one of thekeyword/blockslots holds content (this is what Preserve Level args through the as_dict round-trip #963 fixed).arc/level.py:152(__str__):all([val for val in self.args.values()])— requires both slots to be populated.Consequence: a keyword-only level (the common case, e.g.
args={'keyword': {'opt': 'opt=(verytight)'}}) serialises its args correctly but stays silent about them in its string representation, so the args are invisible in logs and in anything that renders a level viastr().This is cosmetic — it affects log/repr text only, not the round-trip or job args — but the divergence is a trap for the next reader.
Suggested fix: extract one named helper (e.g.
Level.has_args() -> bool) returningbool(self.args) and any(v for v in self.args.values()), and call it from both sites. A unit test asserting that a keyword-only level shows its keyword args instr(level)would pin the behaviour.