Skip to content

Duong's Blog

About technology stuff that piqued my interest

  • English
  • Vietnamese
  • About me

Tag: init_subclass

  • Home
  • init_subclass

Dùng init_subclass để thay thế cho metaclass

February 17, 2022February 17, 2022 duongnt.bk1 Comment on Dùng init_subclass để thay thế cho metaclass

Metaclass là một tính năng thú vị của Python. Nhưng trong một số trường hợp, nó là phức tạp hơn mức cần thiết. Lúc đó, ta có thể sử dụng hàm `init_subclass`.

Python, Vietnamese init_subclass, metaclass, python

Use init_subclass to replace metaclasses

February 17, 2022February 17, 2022 duongnt.bkLeave a Comment on Use init_subclass to replace metaclasses

Metaclass is an interesting feature in Python. But in many situations, it is overkilled. From version 3.6, we can replace it with the `init_subclass` method.

English, Python init_subclass, metaclass, python
Copyright © 2025 Duong's Blog All rights reserved. Theme: Flash by ThemeGrill. Powered by WordPress