Python: In Python, which comparison about Abstract Base Classes vs Protocols is accurate?

Difficulty:

Easy

Questions:

1

Time Limit:

2 minutes

Passing Score:

100%

Question

In Python, which comparison about Abstract Base Classes vs Protocols is accurate?

  1. ABCs are stronger when shared base behavior or registration matters, while protocols are stronger when the code only cares about capabilities.
  2. There is no practical difference in behavior, performance, or maintainability when Abstract Base Classes vs Protocols is involved.
  3. The oldest option related to Abstract Base Classes vs Protocols is always the right production choice regardless of workload or context.
  4. Differences around Abstract Base Classes vs Protocols are mostly cosmetic, so correctness and debugging quality do not really change.

Hint

Focus on the behavior or tradeoff, not just the keyword.

Answer and rationale

Correct answer: A. ABCs are stronger when shared base behavior or registration matters, while protocols are stronger when the code only cares about capabilities.

ABCs are stronger when shared base behavior or registration matters, while protocols are stronger when the code only cares about capabilities. This is the comparison that usually separates memorization from understanding.

Track: Python