I'm being a bit picky here, but consider this. I pass some unexpected object as a calendar, just an integer perhaps. The previous code would see that it was not `None` and that it was not in the list `CALENDARS` so it would proceed to the raising of a `ValueError` with a helpful description. This new code will cause an `AttributeError` to be raised if calendar is not a string, which is not as helpful as the old behaviour.

I'll leave it up to you as to how this logic should be structured, but I'm keen to avoid the spurious `AttributeError`.