Some external code runs my function of the following code:
def __init__(self,weights=None,threshold=None):
print "weights: ", weights
print "threshold: ", threshold
if weights:
print "weights assigned"
self.weights = weights
if threshold:
print "threshold assigned"
self.threshold = threshold
And this code outputs:
weights: [1, 2]
threshold: 0
weights assigned
I.e. print operator behaves like threshold
is zero, while if
operator behaves like it was not defined.
What is the correct interpretation? What is happening? What is the state of threshold
parameter and how to recognize it?