87 Lesser-known Python Features

This post is for people who use Python daily, but have never actually sat down and read through all the documentation.

David Gilbertson
43 min readJun 29, 2023
Did you know Python could do this? Created by DALL·E via Bing image creator

If you’ve been using Python for years and know enough to get the job done, it’s probably not a wise use of your time to read through several thousand pages of documentation just to maybe discover a handful of new tricks. So I’ve put together a short (by comparison) list of features that aren’t widely used, but are widely applicable to general programming tasks.

This list will of course contain some stuff you already know and have a sprinkling of things you’ll never use, but among them, I hope there are a few that are new and useful to you.

First, a bit of housekeeping:

  • I’ll assume you’re on at least Python 3.8. For the few features added after this, I’ll mention when they were added.
  • There’s no strict order to the list, but the more basic features are toward the start.
  • Wherever you see assert on this page, you can assume that the assert passes.
  • If you would like to quench my curiosity, you can highlight the titles of the ones you find useful.

Now, on to the list…

1. help(x)

--

--