You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Just using an if statement will usually make the code cleaner. The most compelling reason to not use asserts is to get more useful exceptions. For example, in https://github.com/MITLibraries/solenoid/blob/master/solenoid/elements/views.py#L90 the better solution will be to just remove any asserts or checks and let the app fail with a KeyError if the item doesn't exist at the time you try to access it.
The text was updated successfully, but these errors were encountered:
These are okay in tests, but not something that should generally be used in production code. There are a few cases here where it has been done: https://github.com/MITLibraries/solenoid/search?q=assert&unscoped_q=assert
Just using an if statement will usually make the code cleaner. The most compelling reason to not use asserts is to get more useful exceptions. For example, in https://github.com/MITLibraries/solenoid/blob/master/solenoid/elements/views.py#L90 the better solution will be to just remove any asserts or checks and let the app fail with a
KeyError
if the item doesn't exist at the time you try to access it.The text was updated successfully, but these errors were encountered: