scikit-hep / mplhep

Extended histogram plotting on top of matplotlib and HEP collaboration compatible styling
https://mplhep.readthedocs.io
MIT License
189 stars 66 forks source link

fix: make passing colors as tuple safe #449

Closed jjhw3 closed 1 year ago

jjhw3 commented 1 year ago

Hi, sorry to raise this again, but it occurred to me that the previous solution would have nasty effects if you passed a generator in as an argument as it would loop through all the items in the generator. This is a safer implementation thanks to short-circuit evaluation.

andrzejnovak commented 1 year ago

Hah, somehow I don't think that happens often, but thanks for catching it.