Bug: AttributeError when instantiating Vehicle in parking_lot.py and missing Enum import in parking_lot.ipynb

Author: cynicalmindsetCreated Sep 28, 2026Updated Sep 28, 2026

Expected Behavior

  • Instantiating any vehicle (Motorcycle, Car, or Bus) from solutions/object_oriented_design/parking_lot/parking_lot.py should properly set self.spot_size.
  • Running the solution code cell in solutions/object_oriented_design/parking_lot/parking_lot.ipynb should execute cleanly without import errors.

Actual Behavior

  1. AttributeError in parking_lot.py (Line 17): Calling Motorcycle('ABC') immediately raises:
    Traceback (most recent call last):
      File "solutions/object_oriented_design/parking_lot/parking_lot.py", line 17, in __init__
        self.spot_size
    AttributeError: 'Motorcycle' object has no attribute 'spot_size'

Source: donnemartin/system-design-primer