"If a worker wants to do his job well, he must first sharpen his tools." - Confucius, "The Analects of Confucius. Lu Linggong"
Front page > Programming > Python common pitfalls

Python common pitfalls

Published on 2024-08-23
Browse:808

Python common pitfalls

A medium article i just published (more to come on this) that captures what i think are the basic pitfalls of getting started with python, would love to hear opinions about it. https://medium.com/@snir-orlanczyk/python-common-pitfalls-and-how-to-avoid-them-c61e0d9ea0ec

it covers the following:

  1. How does python passes arguments and what to watch for with it? (hint: mutable vs immutable)
  2. Mutable default arguments
  3. Python scope rules (and specifically scope shadowing)
  4. Loop variables in Lambdas (a bug or a feature? or something in between)
  5. Modifying list while iterating it (seem obvious but how to avoid it)
Release Statement This article is reproduced at: https://dev.to/sniro/python-common-pitfalls-4h17?1 If there is any infringement, please contact [email protected] to delete it
Latest tutorial More>

Disclaimer: All resources provided are partly from the Internet. If there is any infringement of your copyright or other rights and interests, please explain the detailed reasons and provide proof of copyright or rights and interests and then send it to the email: [email protected] We will handle it for you as soon as possible.

Copyright© 2022 湘ICP备2022001581号-3