Learning a new skill? I bet you're making 2 big mistakes. 1. You're focusing too much on consuming information 2. You're not focusing enough on repetition I notice new Python learners falling into this trap. It's a big problem with the resources we use to learn and the way we talk about and use those resources. ๐Ÿงต #learning #teaching #Python
Why do we use "is" when checking for None in Python? 2 reasons you'll hear: 1. Python objects can overload "==" but not "is" so an object could say it's equal to None but "is" will only check for the (one and only) None 2. Using "is" doesn't even look at the object, but only looks at its memory location so it's technically faster I don't find those reasons convincing, but I DO use "is" to check for None. Why? PEP 8. I don't have a decent reason for bucking convention, so I stick with it.
Have you used "raise ... from None" in #Python? If so, what was your use case for "from None"? What was the original exception that you were suppressing from the traceback and do you feel that suppression was helpful for users of your code (or were you just having fun with a new thing you learned)?
An assignment in Python points a variable to an object. Read more ๐Ÿ‘‰ #Python