is there any way to prevent side effects in python?

后端 未结 7 2026
别跟我提以往
别跟我提以往 2021-02-05 15:14

Is there any way to prevent side effects in python? For example, the following function has a side effect, is there any keyword or any other way to have the python complain abou

7条回答
  •  走了就别回头了
    2021-02-05 15:59

    Sorry really late to the party. You can use effect library to isolate side-effects in your python code. As others have said in Python you have to explicitly write functional style code but this library really encourages towards it.

提交回复
热议问题