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

Implement hash methods in C++ #610

Merged
merged 2 commits into from
Jan 29, 2024
Merged

Conversation

eltoder
Copy link
Contributor

@eltoder eltoder commented Jan 29, 2024

Also, expose them into Java as hashCode().

@lballabio lballabio added this to the Release 1.34 milestone Jan 29, 2024
@lballabio lballabio merged commit 71ed9ee into lballabio:master Jan 29, 2024
8 checks passed
@eltoder eltoder deleted the feature/hash-cpp branch January 29, 2024 14:31
@eltoder eltoder mentioned this pull request Jan 29, 2024
eltoder added a commit to eltoder/QuantLib-SWIG that referenced this pull request Jan 29, 2024
* Fix comparing Money in Python: `__eq__` and `__ne__` were missing.

* Expose `__cmp__` as compareTo() in Java. This is the correct name for
  this method. "compare" is for Comparators[1][2]. Note that this is
  only a change for Money. Period and Date did not have `__cmp__`
  exposed in Java until lballabio#610.

* Remove `__cmp__` and `__nonzero__` methods from Python. These were
  Python 2 magic methods that are not used in Python 3[3].

[1] https://docs.oracle.com/javase/8/docs/api/java/lang/Comparable.html#compareTo-T-
[2] https://docs.oracle.com/javase/8/docs/api/java/util/Comparator.html#compare-T-T-
[3] https://docs.python.org/3/reference/datamodel.html
eltoder added a commit to eltoder/QuantLib-SWIG that referenced this pull request Jan 30, 2024
* Fix comparing Money in Python: `__eq__` and `__ne__` were missing.

* Expose `__cmp__` as compareTo() in Java. This is the correct name for
  this method. "compare" is for Comparators[1][2]. Note that this is
  only a change for Money. Period and Date did not have `__cmp__`
  exposed in Java until lballabio#610. Also, implement Comparable<T> interface.

* Remove `__cmp__` and `__nonzero__` methods from Python. These were
  Python 2 magic methods that are not used in Python 3[3].

[1] https://docs.oracle.com/javase/8/docs/api/java/lang/Comparable.html#compareTo-T-
[2] https://docs.oracle.com/javase/8/docs/api/java/util/Comparator.html#compare-T-T-
[3] https://docs.python.org/3/reference/datamodel.html
eltoder added a commit to eltoder/QuantLib-SWIG that referenced this pull request Jan 30, 2024
* Fix comparing Money in Python: `__eq__` and `__ne__` were missing.

* Expose `__cmp__` as compareTo() in Java. This is the correct name for
  this method. "compare" is for Comparators[1][2]. Note that this is
  only a change for Money. Period and Date did not have `__cmp__`
  exposed in Java until lballabio#610. Also, implement Comparable<T> interface.

* Remove `__cmp__` and `__nonzero__` methods from Python. These were
  Python 2 magic methods that are not used in Python 3[3].

[1] https://docs.oracle.com/javase/8/docs/api/java/lang/Comparable.html#compareTo-T-
[2] https://docs.oracle.com/javase/8/docs/api/java/util/Comparator.html#compare-T-T-
[3] https://docs.python.org/3/reference/datamodel.html
eltoder added a commit to eltoder/QuantLib-SWIG that referenced this pull request Jan 30, 2024
* Fix comparing Money in Python: `__eq__` and `__ne__` were missing.

* Expose `__cmp__` as compareTo() in Java. This is the correct name for
  this method. "compare" is for Comparators[1][2]. Note that this is
  only a change for Money. Period and Date did not have `__cmp__`
  exposed in Java until lballabio#610. Also, implement Comparable<T> interface.

* Remove `__cmp__` and `__nonzero__` methods from Python. These were
  Python 2 magic methods that are not used in Python 3[3].

[1] https://docs.oracle.com/javase/8/docs/api/java/lang/Comparable.html#compareTo-T-
[2] https://docs.oracle.com/javase/8/docs/api/java/util/Comparator.html#compare-T-T-
[3] https://docs.python.org/3/reference/datamodel.html
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.

None yet

2 participants