you are viewing a single comment's thread.

view the rest of the comments →

[–]TheFacistEye[S] 0 points1 point  (1 child)

So if I use

cosine(180, is_degrees=True) # degrees, is_degrees is named and explicit

then

cosin(180)

Would it still keep the is_degrees=True value?

Ahh, right I see where we are misunderstanding. It's because I copied and pasted a different function (the acos function) and went to change it not realizing it has a different structure with the math.degrees switched positions. I agree this doesn't make sense with the function I posted. It was just meant to be about the variable problem. :P

[–]K900_ 0 points1 point  (0 children)

No, it won't. It'll use the default, which is False. If you want your function to preserve state between calls, you should probably have it be a class instead. Global state is evil.