Home > Backend Development > Python Tutorial > python original class

python original class

巴扎黑
Release: 2016-12-07 11:21:35
Original
1321 people have browsed it

What is the use of metaclass?

Good question, metaclass will be called when creating a new class that uses it, here are some views on the benefits of doing so:

◆ Decorate class All methods for logging or profiling.

◆ New method for automatic Mix-in

◆ Register classes on creation. (For example, automatically register plug-ins or create database schemas from class members.)

◆ Provide interface registration, automatic function discovery and interface adaptation.

◆ Class verification: Prevent subclassing and verify whether all methods have docstrings.


Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template