-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Set __hash__ to None for types that defines __eq__ but not __hash__ #2291
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
Conversation
Fine with me. I just saw @jbarlow83's remark (#2287 (comment)). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. Just a couple minor questions about a comment and a test.
I did the docs PR when we still had the believe that the impact of actually solving it was too high. I'll close that one in favour of this, as it is no longer required. Thanks everybody for resolving this ❤️ |
01745f4
to
6cd7749
Compare
6cd7749
to
88dae38
Compare
I think this was approved by everyone? I'm merging. Thank you very much, once again, @sizmailov! :-) |
Backward compatible. Relevant pybind11 change: pybind/pybind11#2291 Note: This pybind11 change makes pybind11 compatible with native Python behavior: * https://docs.python.org/3/reference/datamodel.html#object.__hash__ * A class that overrides __eq__() and does not define __hash__() will have its __hash__() implicitly set to None. PiperOrigin-RevId: 327879230 Change-Id: I8573b761ec94e8889b4eb5ac30a71ee0314e6578
…esults in an 'unhashable type' for PythonProxyObject. (See pybind/pybind11#2291 ) Signed-off-by: Steve Pham <[email protected]>
* Update pyside2 package and deprecated message * Update pytest and pybind versions * Fix python 3.10 where subprocess.run is outputing its --help argument result from calling SerializeContextTools to stderr instead of stdout, even though the result code is zero * Fix error from PythonProxyObject with PyBind11 update to 2.7.1 that results in an 'unhashable type' for PythonProxyObject. (See pybind/pybind11#2291 ) * Fix deprecations errors caused be direct construction of EditorTestClass * Fix crash caused by calling trying to access 'PyErr_Occurred' after pybind11::finalize_interpreter. "Shut down the Python interpreter. No pybind11 or CPython API functions can be called after this. In addition, pybind11 objects must not outlive the interpreter:" * Fix crash caused by calling trying to access 'PyErr_Occurred' after pybind11::finalize_interpreter. According to https://pybind11.readthedocs.io/en/stable/reference.html : "Shut down the Python interpreter. No pybind11 or CPython API functions can be called after this. In addition, pybind11 objects must not outlive the interpreter:" * Fix unit test that expected an unknown result from a crash, but is actually receiving a fail result * Updates to support Python 3.10 on Linux * Update versions in cmake scripts to 3.10.5 * Update 3rd Party Package References to python 3.10.5 related dependencies (pybind11, pyside2) * Update PythonLoader_Linux to support new version * Add PythonLoader instance to PythonSystemComponent to load/unload python3.10.5.so properly to fix new 3.8+ issue with undefined symbols (see https://docs.python.org/3/whatsnew/3.8.html#changes-in-the-c-api) * Fix python 3.10 syntax error (using 'is' instead of '==' for an integer comparison) * Minor hack for 'test_single_crash_test' to resolve an assertion based on the expected result type * Update linux package hash for OpenImageIO / OpenColorIO * Add Pyside2::Tools dependency for QtForPython * Replace hard coded python shared library name with one that is extracted from the python library target * Cleanup norecursedirs in pytest.ini * Fix mac compile error : Users/spham/github/o3de/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Instance/InstanceDomGenerator.cpp:53:44: error: no viable conversion from 'optional<reference_wrapper<AzToolsFramework::Prefab::Instance>>' to 'optional<reference_wrapper<const AzToolsFramework::Prefab::Instance>>' InstanceOptionalConstReference focusedInstance = prefabFocusInterface->GetFocusedPrefabInstance(s_editorEntityContextId); ^ * Replace hardcoded python major/minor version number strings with a define passed in based on LY_PYTHON_VERSION_MAJOR_MINOR defined in LYPython.cmake * Replace StringFunc::Path with AZ::IO::FixedPath to retrieve the filename from a path * Applying suggestion from PR comments on reporting the state of a stoppython call Signed-off-by: Steve Pham <[email protected]>
PR patches
py::class_<>::def
as discussed in #2287fixes #2191