In this article we will explore some lesser known, but interesting and useful corners of Python standard library.

To provide more powerful containers for storing data in memory Python ships a collection module …

Python has with keyword to create context manager that will auto-cleanup things within lexical scope …

To address this problem, Python ships decimal module that allows us represent decimal numbers as Python objects with operator overloading …

Likewise, we can run into problem when dealing with fractions - one third is not exactly equal to 0.333… Python ships with fractions module to represent them as Python objects with operator overloading …

The standard Python installation ships with dis module that takes Python code units (e.g. a function) and disassembles the code into a kind of pseudo-assembler …

Python statistics module provides a small toolkit of statistical algorithms for relatively simple applications where it is an overkill to use Pandas or Numpy: standard deviation, several kinds of average of numeric data, linear regression, correlation, normal distribution and others …

To make this easier Python ships a webbrowser module with simple API to make a browser show a page …

To make this less terrible Python ships zipapp module with CLI tool and Python API to package Python code into single file packages …

No comments yet!

Python

!python@programming.dev

Create post

Welcome to the Python community on the programming.dev Lemmy instance!

📅 Events
October 2023
November 2023
Past

July 2023

August 2023

September 2023

🐍 Python project:
💓 Python Community:
✨ Python Ecosystem:
🌌 Fediverse
Communities
Projects
  • Pythörhead: a Python library for interacting with Lemmy
  • Plemmy: a Python package for accessing the Lemmy API
  • pylemmy pylemmy enables simple access to Lemmy’s API with Python
  • mastodon.py, a Python wrapper for the Mastodon API
Feeds

Community stats

  • 528

    Monthly active users

  • 396

    Posts

  • 1.9K

    Comments