So I think we should not use the .keys() (and not use lower()), and also make sure that we are really using a CaselessDict (i.e., that we did not cast it to a normal dict at some point).
BTW, even for regular dicts, the PEP8 also recommends using foo in mydict over foo in mydict.keys()
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The PATCH has been sent
PATCH
See the improved patch sent to the develop mailing list.
I have some issues with the approach. I think we should not use lower() here. See some motivation in https://sourceforge.net/p/sardana/tickets/498/#e443/678e
I think we should consider an alternative approach, maybe based in using case-insensitive comparisons from CaselessDict. See this snippet:
So I think we should not use the
.keys()(and not uselower()), and also make sure that we are really using a CaselessDict (i.e., that we did not cast it to a normal dict at some point).BTW, even for regular dicts, the PEP8 also recommends using
foo in mydictoverfoo in mydict.keys()The new patch was sent to the develop mailing list.
Patch applied to develop and support-3.x branches
Great solution, thanks!