re: 3 Tricky Python Nuances VIEW POST

re: 1) you should use a linter like pylint to avoid mistakes like this 2) is can be confusing for small integers because they share references 1 is 1 =...

1.) I mean. I almost always find “you should use a linter and then you can avoid learning” to be an unhelpful piece of advice. Also, a linter’s not going to tell you why a nested array is behaving unexpectedly.
2) And true. Python can definitely get a little weird around the edges when you get to arbitrarily large numbers. I hope you’re not hardcoding and checking for identity for integers like this in your code.

You clearly understand references very well! These short examples are, of course, aimed at introducing a concept and encouraging people to learn more. Thanks for providing some trivia!

code of conduct - report abuse