Solved "is not True" — isn't that bad style? HEHenryWritesOP 23 Sep, 14:27 PEP 8 says don't compare booleans with is.
JAJackStack23 Sep, 21:42 Solutionreplies: 2In general, yes. But here it's intentional: you want to accept only the value True and reject truthy values like "yes" or 1. For irreversible actions, strictness beats style rules. The challenge explains exactly this.
BEBellaRossi24 Sep, 09:47Some real APIs use the same pattern for destructive actions: delete(id, *, force=True).
OLOllieGrant24 Sep, 07:16The * in the signature is the main lesson — the caller can't pass confirm without naming it.
Comments 4
Join the discussion CommentAlready have an account? Log in
In general, yes. But here it's intentional: you want to accept only the value True and reject truthy values like "yes" or 1. For irreversible actions, strictness beats style rules. The challenge explains exactly this.
Context matters. Makes sense for an abort.
Some real APIs use the same pattern for destructive actions:
delete(id, *, force=True).The
*in the signature is the main lesson — the caller can't pass confirm without naming it.