MCPcopy Index your code
hub / github.com/nodejs/node / with_metaclass

Function with_metaclass

tools/inspector_protocol/jinja2/_compat.py:85–93  ·  view source on GitHub ↗

Create a base class with a metaclass.

(meta, *bases)

Source from the content-addressed store, hash-verified

83
84
85def with_metaclass(meta, *bases):
86 """Create a base class with a metaclass."""
87 # This requires a bit of explanation: the basic idea is to make a
88 # dummy metaclass for one level of class instantiation that replaces
89 # itself with the actual metaclass.
90 class metaclass(type):
91 def __new__(cls, name, this_bases, d):
92 return meta(name, bases, d)
93 return type.__new__(metaclass, 'temporary_class', (), {})
94
95
96try:

Callers 3

ExtensionClass · 0.90
ContextClass · 0.90
NodeClass · 0.90

Calls 1

__new__Method · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…