Will crash with None has no attribute refractive_index,
I think that particular __eq__ method is buggy. There should be a general expectation that __eq__ can be used with unexpected types and should return NotImplemented or False rather than raise an exception.