chrysn / aiocoap

The Python CoAP library
Other
264 stars 119 forks source link

Option.option_list returns iterator #238

Open wrobell opened 3 years ago

wrobell commented 3 years ago

Option.option_list method returns iterator. Method name suggests, that it returns a list.

Also, the method lacks documentation.

chrysn commented 2 years ago

Thanks for the report and sorry I missed it initially.

The non-builtin option access will generally need some love; they're probably quite tricky to use right now.

Did you come to this option with a concrete application, or just found the method browsing the documentation? Knowing what they're used for (outside of implementing the member-like accessors internally) would help moving them in the right direction. (For just deprecating add_option etc. and instead documenting how to implement own options in the style of the member-like accessors is an option right now).