19:49Why I don't like Python's chained comparisons
From the creator
Are multiple comparisons unintuitive or am I out of touch? Python allows multiple comparisons chained together in the same expression. They have their uses, but the chaining can become confusing when operators of different types are mixed. Why is it that less than and greater than are allowed to be chained together? I think this is confusing and should potentially even be removed from Python. ― mCoding with James Murphy (https://mcoding.io) Source code: https://github.com/mCodingLLC/VideosSampleCode Chained comparison docs: https://docs.python.org/3/reference/expressions.html PEP to expand chained comparison: https://www.python.org/dev/peps/pep-0535/ SUPPORT ME ⭐ --------------------------------------------------- Patreon: https://patreon.com/mCoding Paypal: https://www.paypal.com/donate/?hosted_button_id=VJY5SLZ8BJHEE Other donations: https://mcoding.io/donate Top patrons and donors: Laura M, Jameson, John Martin, Vahnekie, Pieter G, Sigmanificient BE ACTIVE IN MY COMMUNITY 😄 --------------------------------------------------- Discord: https://discord.gg/Ye9yJtZQuN Github: https://github.com/mCodingLLC/ Reddit: https://www.reddit.com/r/mCoding/ Facebook: https://www.facebook.com/james.mcoding CHAPTERS --------------------------------------------------- 0:00 Intro to chained comparisons 4:25 Good use cases 5:40 Questionable use cases 7:36 Bad use cases 10:42 Numpy use case
Published 2021-09-04 · Watch on YouTube ↗
Availability and playback restrictions are controlled by the original channel.
Keep exploring Learn to Code
19:49
16:34From Backyard Telescopes to AI‑Powered Art Sales, on Mr. Maeda's Cozy AI Kitchen
Microsoft Developer
12:36
01:41
19:30Next-Level SQL in VS Code: GitHub Copilot Custom Instructions, Plan Mode & Skills | Data Exposed
Microsoft Developer
06:01PostgreSQL Like a Pro: Experience performance under pressure with PostgreSQL on Azure
Microsoft Developer
22:51