blob: a7370d0baacefc0949fab1d681e72045cbb8dea2 [file] [log] [blame] [edit]
# Unary operators
- foo
+ foo
~ foo
- +foo
- + ~foo
not foo
# Binary operators
foo=bar+baz+qux
foo=bar-baz-qux
foo=bar*baz*qux
foo=bar/baz/qux
foo=bar//baz//qux
foo=bar%baz%qux
foo=bar|baz|qux
foo=bar&baz&qux
foo=bar^baz^qux
foo=bar<<baz<<qux
foo=bar>>baz>>qux
foo=~bar|~baz^-qux<<quux>>baa
# If-else operator precedence
- f(1) if not a else 2+3
# Logic operators
not foo<bar>baz<=foo>=bar!=baz in foo==bar or baz
x = "abc" in copts or "def" in copts
x2 = "abc" not in copts and "def" not in copts
y = "abc" in (copts or []) == False
a = 1 + 2 if 3 + 4 else 5 + 6
# Augmented assignments
foo+=bar
foo-=bar
foo*=bar
foo/=bar
foo//=bar
foo%=bar
foo|=bar
foo&=bar
foo^=bar
foo<<=bar
foo>>=bar