libbdsg icon indicating copy to clipboard operation
libbdsg copied to clipboard

Update net_handle_t bindings to include equality and hash

Open xchang1 opened this issue 2 years ago • 1 comments

I wanted net_handle_t's to be used in sets in python so I needed the bindings to include equality and hashing.

@adamnovak or maybe @ctcisar, can I do this? It looks like the binding code is automatically generated so I'm worried it'll get overwritten, but this was the only way I could figure out to get it to do what I wanted

xchang1 avatar Sep 09 '23 14:09 xchang1

I don't think this will stick around. I think we would need a member operator== for BInder to bind it to Python's equality check: https://cppbinder.readthedocs.io/en/latest/limitations.html#external-operators

If we want to customize the bindings for a type, we can use an +add_on_binder directive in the Binder config file, break this code out into its own function that takes I think cl as an argument, and then get Binder to generate the code to call that function: https://cppbinder.readthedocs.io/en/latest/config.html?highlight=add_on_binder#config-file-directives

adamnovak avatar Jul 09 '24 19:07 adamnovak