#Meltdown Mitigation in Python, my code runs, but has "Code Smell"

1 messages · Page 1 of 1 (latest)

vagrant edge
#

Here is my code, which runs, but has "Code Smell" on the following line.

I read a bit on Code Smell, and I get it, but I don't see how to simplify the code in question.

(I'm only posting the smelly lines because the code block was well over the character limit for a post.)

        return 'NORMAL'```
wicked tundra
#

with python you can just write logical chain like normal math when it involve number comparison

#

how would you write this out like normal math?

vagrant edge
wicked tundra
#

this is a simple one. let say i can write : 1 < 2 and 3 > 2. how would you chain them together?

wicked tundra
#

yeah.did it pass?

vagrant edge
#

it did, thanks

wicked tundra
#

hey can you do me a favor and try this for me. see if it also pass

#

if 0.9 < (temp_neut / threshold) < 1.1:

vagrant edge
#

ok, one sec

#

no, it didn't

wicked tundra
#

Ok, thanks you. The logic is similar but I wasnt sure if the comparison gonna hold because of math division in python

vagrant edge
#

Thanks for your help 🙂