jhao104 / jhao104/proxy_pool

有一段代码看不懂

Open
#593 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
23.7k
Forks
5.4k
PR merge metrics
No merged PRs in 30d

Description

`
def withMetaclass(meta, *bases):
"""Create a base class with a metaclass."""

# This requires a bit of explanation: the basic idea is to make a dummy
# metaclass for one level of class instantiation that replaces itself with
# the actual metaclass.
class MetaClass(meta):

def __new__(cls, name, this_bases, d):
return meta(name, bases, d)

return type.__new__(MetaClass, 'temporary_class', (), {})`

这一段代码有什么用???真心求教

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.