MCPcopy Create free account
hub / github.com/aboutcode-org/scancode-toolkit / new_class

Function new_class

src/licensedcode/_vendor/attr/_compat.py:37–44  ·  view source on GitHub ↗

A minimal stub of types.new_class that we need for make_class.

(name, bases, kwds, exec_body)

Source from the content-addressed store, hash-verified

35 return isinstance(klass, (type, types.ClassType))
36
37 def new_class(name, bases, kwds, exec_body):
38 """
39 A minimal stub of types.new_class that we need for make_class.
40 """
41 ns = {}
42 exec_body(ns)
43
44 return type(name, bases, ns)
45
46 # TYPE is used in exceptions, repr(int) is different on Python 2 and 3.
47 TYPE = "type"

Callers 2

make_classFunction · 0.85
cmp_usingFunction · 0.85

Calls 1

typeClass · 0.50

Tested by

no test coverage detected