Jason Novinger@programming.devM to Python@programming.dev · 7 days agoPython Performance: Why 'if not list' is 2x Faster Than Using len()blog.codingconfessions.comexternal-linkmessage-square12fedilinkarrow-up14arrow-down10cross-posted to: technology@lemmy.world
arrow-up14arrow-down1external-linkPython Performance: Why 'if not list' is 2x Faster Than Using len()blog.codingconfessions.comJason Novinger@programming.devM to Python@programming.dev · 7 days agomessage-square12fedilinkcross-posted to: technology@lemmy.world
minus-square🇦🇺𝕄𝕦𝕟𝕥𝕖𝕕𝕔𝕣𝕠𝕔𝕕𝕚𝕝𝕖@lemm.eelinkfedilinkEnglisharrow-up0·5 days agoI like the exception being raised their is no reason I should be passing in None to the function it means I’ve fucked up the value of whatever I’m passing in at some point.
minus-squarelogging_strict@programming.devlinkfedilinkarrow-up0·4 days agoOh no a stray None! Take cover … Robust codebase should never fail from a stray None Chaos testing is specifically geared towards bullet proofing code against unexpected param types including None. The only exception is for private support function for type specific checking functions. Where it’s obviously only for one type ever. We live in clownworld, i’m a clown and keep the company of shit throwing monkeys.
minus-square🇦🇺𝕄𝕦𝕟𝕥𝕖𝕕𝕔𝕣𝕠𝕔𝕕𝕚𝕝𝕖@lemm.eelinkfedilinkEnglisharrow-up0·4 days agoUr function args if fucked up should always throw an error that’s the entire point of python type hints
minus-squarelogging_strict@programming.devlinkfedilinkarrow-up1·1 day agotype hints are static, not necessarily runtime. A chaos monkey throws everything at everything to see what breaks. That won’t be caught by perfect type hints, which is merely one tool in the toolbox. and when things break, often hear WAD, works as designed. Or some other nonsense excuse.
I like the exception being raised their is no reason I should be passing in None to the function it means I’ve fucked up the value of whatever I’m passing in at some point.
Oh no a stray None! Take cover …
Robust codebase should never fail from a stray None
Chaos testing is specifically geared towards bullet proofing code against unexpected param types including None.
The only exception is for private support function for type specific checking functions. Where it’s obviously only for one type ever.
We live in clownworld, i’m a clown and keep the company of shit throwing monkeys.
Ur function args if fucked up should always throw an error that’s the entire point of python type hints
type hints are static, not necessarily runtime.
A chaos monkey throws everything at everything to see what breaks.
That won’t be caught by perfect type hints, which is merely one tool in the toolbox.
and when things break, often hear WAD, works as designed. Or some other nonsense excuse.