We currently check raw.info['bads'] = ... because we can do it in Info.__setitem__, but we don't check raw.info['bads'] += because this is a += operation on the bads list. One hopefully easy way to fix this would be to subclass List to check any inplace ops (append, extend, +=, ...?) to check if the channels can be added. This would require keeping a reference to the Info object, though (because you need the channel names), but that should be possible in principle I think.
We currently check
raw.info['bads'] = ...because we can do it inInfo.__setitem__, but we don't checkraw.info['bads'] +=because this is a+=operation on the bads list. One hopefully easy way to fix this would be to subclassListto check any inplace ops (append, extend, +=, ...?) to check if the channels can be added. This would require keeping a reference to theInfoobject, though (because you need the channel names), but that should be possible in principle I think.