ignore expressions in class definition body (#26)

This commit is contained in:
Sebastien Bourdeauducq 2021-11-02 23:30:12 +08:00
parent 47f563908a
commit e89bc93b5f

View File

@ -1396,6 +1396,7 @@ impl TopLevelComposer {
}
}
ast::StmtKind::Pass => {}
ast::StmtKind::Expr { value: _ } => {} // typically a docstring; ignoring all expressions matches CPython behavior
_ => return Err("unsupported statement type in class definition body".into()),
}
}