Python, being a beautifully designed high-level and interpreter-based programming language, provides us with many features for the programmer's comfort. But sometimes, the outcomes of a Python snippet may not seem obvious at first sight. Here's a fun project attempting to explain what exactly is happening under the hood for some counter-intuitive snippets and lesser-known features in Python. While some of the examples you see below may not be WTFs in the truest sense, but they'll reveal some of the interesting parts of Python that you might be unaware of. I find it a nice way to learn the internals of a programming language, and I believe that you'll find it interesting too! If you're an experienced Python programmer, you can take it as a challenge to get most of them right in the first attempt. You may have already experienced some of them before, and I might be able to revive sweet old memories of yours!

Features

  • Schrödinger's variable
  • Half triple-quoted strings
  • Class attributes and instance attributes
  • The disappearing variable from outer scope
  • Modify a dictionary while iterating over it
  • Delete a list item while iterating

Project Samples

Project Activity

See All Activity >

Categories

Documentation

License

MIT License

Follow wtfpython

wtfpython Web Site

Other Useful Business Software
Network Management Software and Tools for Businesses and Organizations | Auvik Networks Icon
Network Management Software and Tools for Businesses and Organizations | Auvik Networks

Mapping, inventory, config backup, and more.

Reduce IT headaches and save time with a proven solution for automated network discovery, documentation, and performance monitoring. Choose Auvik because you'll see value in minutes, and stay with us to improve your IT for years to come.
Learn More
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of wtfpython!

Additional Project Details

Programming Language

Python

Related Categories

Python Documentation Software

Registered

2022-09-06