Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add equality #34

Merged
merged 6 commits into from
Dec 3, 2023
Merged

Add equality #34

merged 6 commits into from
Dec 3, 2023

Conversation

vickumar1981
Copy link
Owner

Copy link

github-actions bot commented Dec 3, 2023

Coverage

Coverage Report
FileStmtsMissCoverMissing
pyeffects
   Either.py42295%101, 116
   Future.py94694%80, 224–225, 248–249, 260
   Monad.py43198%16
   Option.py39295%99, 111
   Try.py61297%106, 199
   __version__.py990%1–9
TOTAL2902292% 

Tests Skipped Failures Errors Time
77 0 💤 0 ❌ 0 🔥 1.822s ⏱️

@vickumar1981
Copy link
Owner Author

@BattiniSandeep I pulled in your changes as part of this PR.

Some notes:

  • Updated to using black: https://github.com/psf/black, over flake8.
  • I kept getting some error with the 3.11 build complaining it couldn't find the module typing-extensions, so I've currently disabled the 3.11 build in the github actions. Will create a separate issue for fixing the 3.11 build.
  • @BattiniSandeep , I gave you a bad comment about updating the signature of __eq__.

The signature of __eq__ should allow comparisons against other types, i.e.:

def __eq__(self, other: object) -> bool:

so object was 100% correct here from your previous commit.

  • I moved the __eq__ operator up to the parent class instead of the respective subclasses, so there's only one implementation each for Option, Try, and Either, instead of separate ones for say Some and then None.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants