Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why say x = x in Python?

In this file, in the function cross_from_below(x, threshold), there is a line that says threshold = threshold. What's the point of this line? Does this do something differently than if this command weren't there?

like image 523
endolith Avatar asked Nov 27 '22 23:11

endolith


1 Answers

There is no point to that assignment. It's probably just left over and should be removed. The next function is nearly identical, and doesn't have it.

like image 152
Ned Batchelder Avatar answered Dec 05 '22 05:12

Ned Batchelder