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
Simplify IT and security with a single endpoint management platform Icon
Simplify IT and security with a single endpoint management platform

Automate the hardest parts of IT

NinjaOne automates the hardest parts of IT, delivering visibility, security, and control over all endpoints for more than 20,000 customers. The NinjaOne automated endpoint management platform is proven to increase productivity, reduce security risk, and lower costs for IT teams and managed service providers. The company seamlessly integrates with a wide range of IT and security technologies. NinjaOne is obsessed with customer success and provides free and unlimited onboarding, training, and support.
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