Overcomplicated NaN Check
# function to check if a string is NaN def isnan(self,value): try: import math return math.isnan(float(value)) except: return False
A Python code snippet checks whether a string is NaN by converting it to a float and calling math.isnan, while catching every exception and returning False. The joke is that the simple check is wrapped in unnecessary complexity and broad error handling, a relatable reaction to overengineered code. EN: A Python code snippet checks whether a string is NaN by converting it to a float and calling math.isnan, while catching every exception and returning False. The joke is that the simple check is wrapped in unnecessary complexity and broad error handling, a relatable reaction to overengineered code.
- @right_wing_dev_squads / 8932 2024-03-15
- Type
- image
- Size
- 640×237 · 26.4 KiB
- Mood
- sarcastic
- Language
- en
- Added