Skip to content

Adds __hash__ fun to Method class - #52

Merged
chrizog merged 1 commit into
chrizog:masterfrom
tudormot:fix_missing_hash
Feb 26, 2026
Merged

Adds __hash__ fun to Method class#52
chrizog merged 1 commit into
chrizog:masterfrom
tudormot:fix_missing_hash

Conversation

@tudormot

Copy link
Copy Markdown

Missing hash function leads to thrown TypeException, Method not hashable, when trying to crete an RPC client.

Presumably eq was added recently. Manually adding eq to a dataclass, leads to hash no longer being generated by default

Test: manually, library doesnt throw expections on my setup anymore

Missing __hash__ function leads to thrown TypeException, Method
not hashable, when trying to crete an RPC client.

Presumably __eq__ was added recently. Manually adding __eq__
to a dataclass, leads to __hash__ no longer being generated by
default

Test: manually, library doesnt throw expections on my setup
Test: anymore
@chrizog

chrizog commented Feb 26, 2026

Copy link
Copy Markdown
Owner

Hi, thanks for your contribution!
Can you please add an example snippet when this Error appears? Which Python Version are you using? Is your example different to the example applications code (example applications are verified for each release)?

Best regards
Christian

@tudormot

Copy link
Copy Markdown
Author

Sorry but I can't post logs anymore, as I've "monkeypatched" my code to add the hash, and don't have time to revert for the concrete proof.

IIRC https://github.com/chrizog/someipy/blob/master/src/someipy/_internal/_daemon/offer_service_storage.py#L65 throwed exception: Method not hashable.

Just tried reproducing with the example applications code, and indeed I can't reproduce. Tried starting daemon, and tunning call_method_tcp.py, offer_method_tcp.py

Not sure what the difference is, maybe SD doesnt fully get triggered by this setup? In my setup, a someip node is written with someipy, it offers a someip service. Another someip node is present somewhere else on the network. Crash happens (in someipyd) when this external node is started up, so it is probably related to the service discovery logic.

@chrizog
chrizog merged commit fd6bf2c into chrizog:master Feb 26, 2026
1 check failed
@tudormot

tudormot commented Mar 2, 2026

Copy link
Copy Markdown
Author

Thank you for accepting the PR, and thank you for the awesome library!

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