MCPcopy
hub / github.com/benoitc/gunicorn / __new__

Method __new__

gunicorn/config.py:262–274  ·  view source on GitHub ↗
(cls, name, bases, attrs)

Source from the content-addressed store, hash-verified

260
261class SettingMeta(type):
262 def __new__(cls, name, bases, attrs):
263 super_new = super().__new__
264 parents = [b for b in bases if isinstance(b, SettingMeta)]
265 if not parents:
266 return super_new(cls, name, bases, attrs)
267
268 attrs["order"] = len(KNOWN_SETTINGS)
269 attrs["validator"] = staticmethod(attrs["validator"])
270
271 new_class = super_new(cls, name, bases, attrs)
272 new_class.fmt_desc(attrs.get("desc", ""))
273 KNOWN_SETTINGS.append(new_class)
274 return new_class
275
276 def fmt_desc(cls, desc):
277 desc = textwrap.dedent(desc).strip()

Callers 3

from_dictMethod · 0.80
async_workerMethod · 0.80
gevent_workerMethod · 0.80

Calls 2

fmt_descMethod · 0.80
getMethod · 0.45

Tested by 2

async_workerMethod · 0.64
gevent_workerMethod · 0.64