- the `gf2` sub-classes `GF2One` and `GF2Zero` have no purpose
other than to provide unique `help(one)` and `help(zero)` messages
- delete them at the bottom of `lalib.elements.galois`
to prevent them from being imported at all
(`type(one)` and `type(zero)` still appear to be the `gf2` class,
which is a little white lie, provided by some meta class)
- differentiate between official and inofficial API in the test suite
- `to_gf2()` is only to be used within `GF2Element.__new__()`
=> rename it into `_to_gf2()`
- the test cases in `TestGF2ConstructorWithCastedValue`
cover everything in `TestGF2Casting`
=> retire the redundant test cases
and make the test suite run faster
- the future (concrete) Galois `Field` implementation
shall receive the name `GF2` (as per common math notation)
=> name conflict with the current `GF2` class
implementing the elements of the future Galois `Field`
=> rename the current `GF2` class into `GF2Element`
- because `GF2Element` is a bit tedius to type for the end user,
we introduce a `gf2` alias in line with the naming convention
for the built-in data types (e.g., `int` or `float`)
that are also used as elements of (other) `Field`s
=> name conflict with the current `lalib.elements.gf2` module
=> rename the module into `lalib.elements.galois`
- adjust the docstrings to refer to "the `gf2` type"
- adjust the top-level imports and tests
2024-09-19 12:14:20 +02:00
Renamed from tests/elements/test_gf2.py (Browse further)