Adds __hash__ fun to Method class - #52
Conversation
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
|
Hi, thanks for your contribution! Best regards |
|
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. |
|
Thank you for accepting the PR, and thank you for the awesome library! |
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