diff options
| author | Michael Williamson <mike@zwobble.org> | 2016-01-14 20:41:16 +0000 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2016-01-14 20:43:22 +0000 |
| commit | 4ea4f22e89e38775fb0436d2c34bf5e0cf1ecfb4 (patch) | |
| tree | ab73a9eccd008c231356e3f773d1a14deaf182ef /README.md | |
| parent | 2630c97f8b21c1b9d741eeafd8137c1d2b57c07d (diff) | |
Remove some unnecessary parens from Python output
Diffstat (limited to 'README.md')
| -rw-r--r-- | README.md | 28 |
1 files changed, 27 insertions, 1 deletions
@@ -16,4 +16,30 @@ two overloads -- one for the supertype, one for the subtype. This needs doing regardless of changes to boxing/unboxing primitives since - we currently use raw strings rather than boxing them into Java strings.
\ No newline at end of file + we currently use raw strings rather than boxing them into Java strings. + +## Python precedence + +The table below gives precedence from lowest to highest in Python 3.5. +Some rows have the same precedence for serialisation to improve code +clarity. + +Operator | Precedence (serialisation) +---------|----------- +`lambda` | 0 +`if – else` | 10 +`or` | 20 +`and` | 20 +`not x` | 40 +`in`, `not in`, `is`, `is not`, `<`, `<=`, `>`, `>=`, `!=`, `==` | 50 +`|` | 60 +`^` | 70 +`&` | 80 +`<<`, `>>` | 90 +`+`, `-` | 100 +`*`, `@`, `/`, `//`, `%` | 110 +`+x`, `-x`, `~x` | 120 +`**` | 130 +`await x` | 140 +`x[index]`, `x[index:index]`, `x(arguments...)`, `x.attribute` | 150 +`(expressions...)`, `[expressions...]`, `{key: value...}`, `{expressions...}`` | 160
\ No newline at end of file |
