types Module Workbook Added to Standard Library Learning Path

Published: (January 3, 2026 at 11:18 PM EST)
2 min read
Source: Dev.to

Source: Dev.to

Overview

I’ve completed and uploaded the types module workbook to my standardlib-datastruct repository. This workbook dives into Python’s runtime object types and CPython internals, providing 18 exercises that cover the most important types from the types module. The goal is comprehensive coverage rather than a specific order, helping you master the types that power Python under the hood.

Types Covered

Function and Method Types

  • FunctionType and LambdaType – regular functions and lambdas
  • MethodType – bound methods
  • BuiltinFunctionType and BuiltinMethodType – built‑in callables

Async and Generator Types

  • GeneratorType – regular generators
  • AsyncGeneratorType – async generators
  • CoroutineType – coroutine objects

Code and Execution Types

  • CodeType – compiled bytecode objects
  • FrameType – execution frames
  • TracebackType – exception tracebacks

Descriptor Types

  • MemberDescriptorType – class attribute descriptors
  • WrapperDescriptorType – low‑level built‑in descriptors
  • GetSetDescriptorType – C‑implemented properties

Utility Types

  • MappingProxyType – read‑only dictionary views
  • ModuleType – module objects
  • EllipsisType – the ... singleton
  • NotImplementedType – the NotImplemented singleton

Workbook Details

  • 18 exercises covering the types listed above.
  • Each exercise includes a clear problem statement and a complete solution with working code examples.
  • The workbook is not beginner‑friendly by design; it assumes you understand Python’s object model and how types work.

Learning Approach

  • Focuses on practical, exercise‑driven learning rather than exhaustive reference material.
  • Uses Python 3.11.
  • Demonstrates how to understand CPython’s internal descriptor types without diving into C code:
    • MemberDescriptorType – attributes implemented in CPython (e.g., accessing attributes)
    • GetSetDescriptorType – properties implemented in CPython (similar to property but in C)
    • WrapperDescriptorType – methods implemented in CPython

Repository

  • Repository:
  • Files included in the release:
    • types_exercises_workbook.md – Markdown format
    • types_exercises_workbook.pdf – PDF format (generated with Pandoc + MiKTeX)
    • types_workbook.py – Source generator script
  • Previous additions: functools workbook, itertools workbook.
  • This is a living project; more standard library modules will be added as they are completed.

Feel free to download, work through the exercises, and adapt them to your learning style.

Back to Blog

Related posts

Read more »

Problem 10: Duplicate Removal

Problem Description We need a function that removes duplicates from a list while preserving the original order of elements. Example remove_duplicates1, 2, 2, 3...