Parentheses on an member
xs.len(): an member reads without ()
let xs = [1, 2, 3]
print(xs.len())let xs = [1, 2, 3]
print(xs.len)Why
Parentheses mark work in CP Lang (decision 140): a member reads without () exactly when it is , so xs.len, xs.first, s.last and t.at read like fields because they are. xs.len() is the C++ and Python spelling and is reported as error E0304 with a fix that drops the (); cpl fix applies it.
The practice it serves
Spelling that hides what the code means.
Not flagged
A near miss: close to the pattern, but not it.
let xs = [1, 2, 3]
print(xs.sum())Turn it off
For one block, wrap it in with lint(parens_on_o1: allow):. For a project, add parens_on_o1 = "allow" under [lints] in cp.toml.
Generated from spec/checker-lints/parens_on_o1, the same record the linter is built from.