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, orBus) fromsolutions/object_oriented_design/parking_lot/parking_lot.pyshould properly setself.spot_size. - Running the solution code cell in
solutions/object_oriented_design/parking_lot/parking_lot.ipynbshould execute cleanly without import errors.
Actual Behavior
- AttributeError in
parking_lot.py(Line 17): CallingMotorcycle('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