catacomb/__init__.py: Prepare rational classes for upcoming changes.
authorMark Wooding <mdw@distorted.org.uk>
Sat, 23 Nov 2019 23:39:21 +0000 (23:39 +0000)
committerMark Wooding <mdw@distorted.org.uk>
Mon, 25 Nov 2019 17:51:31 +0000 (17:51 +0000)
In the near future, we won't be able to guarantee that all rings allow
implicit conversions of (integer) 0 and 1 to the additive and
multiplicative ring identities, so:

  * define `ZERO' and `ONE' class attributes on the concrete classes to
    hold the respective ring identities;

  * make the `_split_rat' function into a private method of the
    `BaseRat' class and adjust callers to match;

  * compare against `ZERO' to detect an exact element of the base ring;
    and

  * return `ONE' as the implicit denominator for a base-ring element or
    foreign object to be converted.

No functional change.


No differences found