Commit f5ad81d
committed
Fix % formatting and Transform equality.
Use `.format(key)` instead of `% key` formatting which fails when `key`
is a tuple (one could also use `% (key,)` but we may as well use the
more modern option).
The `Transform` class doesn't need to override `__eq__` as user-defined
classes default to using identity for equality. This also avoids having
to add a `__hash__` to these classes to make them hashable (by default,
user-defined classes are hashable, but become unhashable (in Py3) if
they define a `__eq__` without defining a `__hash__`). A more complete
PR should define `__hash__` for all `Transform` subclasses too.1 parent c44556f commit f5ad81d
2 files changed
Lines changed: 7 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
118 | 118 | | |
119 | 119 | | |
120 | 120 | | |
121 | | - | |
| 121 | + | |
122 | 122 | | |
123 | 123 | | |
124 | 124 | | |
125 | | - | |
| 125 | + | |
| 126 | + | |
126 | 127 | | |
127 | 128 | | |
128 | 129 | | |
129 | 130 | | |
130 | 131 | | |
131 | | - | |
| 132 | + | |
132 | 133 | | |
133 | 134 | | |
134 | 135 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1156 | 1156 | | |
1157 | 1157 | | |
1158 | 1158 | | |
1159 | | - | |
1160 | | - | |
1161 | | - | |
1162 | | - | |
1163 | | - | |
| 1159 | + | |
| 1160 | + | |
| 1161 | + | |
1164 | 1162 | | |
1165 | 1163 | | |
1166 | 1164 | | |
| |||
0 commit comments