- Encapsulation — đóng gói data + methods, dùng
_(protected) và__(name mangling) - Inheritance —
class Child(Parent), hỗ trợ multiple inheritance, dùngsuper() - Polymorphism — cùng method tên, hành vi khác nhau tùy class; duck typing
- Abstraction — ẩn implementation qua
ABC+@abstractmethod
Lưu ý: Python không có private thật sự — __attr chỉ là name mangling, vẫn access được qua _ClassName__attr.
- Encapsulation — bundle data + methods, use
_(protected) and__(name mangling) - Inheritance —
class Child(Parent), multiple inheritance supported - Polymorphism — same method name, different behavior per class; duck typing
- Abstraction — hide implementation via
ABC+@abstractmethod
Pitfall: Python has no true private — __attr is name mangling, still accessible via _ClassName__attr.