raise Assertionerror vs. assert python

前端 未结 1 584
北荒
北荒 2021-01-18 03:42

What are the big differences between raise Assertionerror and assert to build in a \"fault\". What are the effects on the code ? and is one or the other more pythonic in a w

1条回答
  •  天涯浪人
    2021-01-18 04:18

    Those two code examples are equivalent, with the exception that assert statements can be globally disabled with the -O command-line flag.

    0 讨论(0)
提交回复
热议问题