As you can see, if the expression evaluates to False, the error is thrown. The only palatable difference is that assert always throws an AssertionError - with raise you can to tell it what type of exception you want to raise i.e. OSError .