[WIP]feat: code upgrades/streamlining from python 3.10 => 3.11 #1211
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What was wrong?
There is a need to explore changes from Python 3.10 => 3.11 that might affect the repo or are potentially interesting for improving code quality.
Fixes #1167
How was it fixed?
Went through each feature outlined in #1167 and implemented changes wherever necessary to improve the code
PEP 673 – Self Type:
typing.Self
in:finite_field.py
(Field, PrimeField, GaloisField protocols/classes)elliptic_curve.py
(EllipticCurve class methods)PEP 654 – Exception Groups and except*:
PEP 678 – Enriching Exceptions with Notes:
dataclasses:
enum:
hashlib.file_digest:
logging.getLevelNamesMapping:
re Atomic grouping and possessive quantifiers:
string:
shutil.rmtree:
time.sleep:
typing:
python/cpython#90881
python/cpython#57684
Cute Animal Picture