Skip to main content Brad's PyNotes

Posts on Stdlib

  1. Socket Module

    TL;DR

    The socket module provides low-level access to BSD sockets for network programming. It supports TCP and UDP protocols across IPv4 and IPv6, offering both connection-oriented and connectionless communication patterns for building custom network applications.

  2. gc Module - Garbage Collection Control

    TL;DR

    The gc module provides an interface to Python’s garbage collector, allowing you to manually trigger collection, disable automatic collection, debug memory leaks, and tune performance. It’s particularly useful for finding reference cycles, optimizing memory usage in long-running processes, and understanding what objects are consuming memory.

  3. Difflib Module

    TL;DR

    The difflib module provides tools for comparing sequences (especially text strings) and generating difference reports in various formats. It can find the similarity between strings, produce unified or context diffs like Unix diff tools, and identify close matches from a list of possibilities.