MCPcopy Create free account
hub / github.com/ActiveState/code / __new

Method __new

recipes/Python/578152_threadboxpy/recipe-578152.py:78–91  ·  view source on GitHub ↗

Allocates space for instance and finds __exec attribute.

(meta, cls, *args, **kwargs)

Source from the content-addressed store, hash-verified

76
77 @classmethod
78 def __new(meta, cls, *args, **kwargs):
79 "Allocates space for instance and finds __exec attribute."
80 self = object.__new__(cls)
81 if 'master' in kwargs:
82 self.__exec = kwargs['master'].__exec
83 else:
84 valid = tuple(meta.__REGISTRY.values())
85 for value in args:
86 if isinstance(value, valid):
87 self.__exec = value.__exec
88 break
89 else:
90 self.__exec = affinity.Affinity()
91 return self

Callers

nothing calls this directly

Calls 2

__new__Method · 0.45
valuesMethod · 0.45

Tested by

no test coverage detected