Is there a tool that enables you to annotate functions/methods as “pure” and then analyzes the code to test if said functions/methods are side effect free ?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
In the Python world, the question doesn’t make much sense since objects have so much say in what happens in a function call.
For example, how could you tell if the following function is pure?
The answer depends on what x is:
Though the function f looks pure, the add operation on x has the side-effect of incrementing s.