Returns the same Decimal object. As we do not have different encodings for the same number, the received object already is in its canonical form. >>> ExtendedContext.canonical(Decimal('2.50')) Decimal('2.50')
(self, a)
| 4150 | return str(a._fix(self)) |
| 4151 | |
| 4152 | def canonical(self, a): |
| 4153 | """Returns the same Decimal object. |
| 4154 | |
| 4155 | As we do not have different encodings for the same number, the |
| 4156 | received object already is in its canonical form. |
| 4157 | |
| 4158 | >>> ExtendedContext.canonical(Decimal('2.50')) |
| 4159 | Decimal('2.50') |
| 4160 | """ |
| 4161 | if not isinstance(a, Decimal): |
| 4162 | raise TypeError("canonical requires a Decimal as an argument.") |
| 4163 | return a.canonical() |
| 4164 | |
| 4165 | def compare(self, a, b): |
| 4166 | """Compares values numerically. |
nothing calls this directly
no test coverage detected