Week 10: Classes and Objects

223 words
1 min read
Python Week 1: the first filter for runtime behavior
Visual companion
Python
Type and operator map

Python Week 1: the first filter for runtime behavior

View
Revision summary

What this note is really saying

Short form

# Week 10: Classes and Objects > **Course:** Jan 2026 - Python > **Focus:** Object creation, method behavior, and shared class state. --- ## 1.

Visual strip

Relevant recall pieces for this note

Open gallery

Week 10: Classes and Objects

Course: Jan 2026 - Python Focus: Object creation, method behavior, and shared class state.

1. Core idea

Week 10 is the first real object-oriented checkpoint: create objects, store state, and let methods operate on that state.

What to remember

  • __init__ runs when an object is created.
  • self refers to the current object.
  • Instance attributes belong to one object.
  • Class attributes are shared across all objects.
  • A method must use self to reach the object's data.

2. Common traps

  • Calling a constructor with the wrong number of arguments.
  • Forgetting that a class counter counts object creation.
  • Confusing a method definition with a method call.
  • Printing members depends on how the container stores them, usually in insertion order.

3. Speedrun pattern

When you see a Week 10 question, ask:
  1. Is this about an object or the class itself?
  2. Does the question test state, behavior, or counting?
  3. Which attribute is shared and which one is per object?

4. Micro revision

  • Constructor = __init__
  • Shared state = class attribute
  • Object state = instance attribute

Assignment anchor

  • Previous: Week 9 Notes
  • Next: none in the normal assignment track
Document Outline
Table of Contents
System Normal // Awaiting Context

Intelligence Hub

Navigate the knowledge graph to generate context. The Hub adapts dynamically to surface backlinks, related notes, and metadata insights.