The expectation expect(e, X), or expect(d) for a distribution's own mean.
Why not E[ยท]. Square brackets are the matrix literal, so E[X] would parse as E times a one-element matrix. expect is unambiguous and needs no grammar change.
The one-argument form is the mean of a distribution; the two-argument form is E[e] where x names the random variable inside e, and is where the linearity rules live.
Value parameters
e
the expression whose expectation is wanted, or the distribution itself
x
the random variable, or None for the one-argument form