MCPcopy Create free account
hub / github.com/bundesAPI/smard-api / wrapped_init

Function wrapped_init

python-client/deutschland/smard/model_utils.py:38–49  ·  view source on GitHub ↗

An attribute named `self` received from the api will conflicts with the reserved `self` parameter of a class method. During generation, `self` attributes are mapped to `_self` in models. Here, we name `_self` instead of `self` to avoid conflicts.

(_self, *args, **kwargs)

Source from the content-addressed store, hash-verified

36
37 @wraps(fn)
38 def wrapped_init(_self, *args, **kwargs):
39 """
40 An attribute named `self` received from the api will conflicts with the reserved `self`
41 parameter of a class method. During generation, `self` attributes are mapped
42 to `_self` in models. Here, we name `_self` instead of `self` to avoid conflicts.
43 """
44 spec_property_naming = kwargs.get("_spec_property_naming", False)
45 if spec_property_naming:
46 kwargs = change_keys_js_to_python(
47 kwargs, _self if isinstance(_self, type) else _self.__class__
48 )
49 return fn(_self, *args, **kwargs)
50
51 return wrapped_init
52

Callers

nothing calls this directly

Calls 2

change_keys_js_to_pythonFunction · 0.85
getMethod · 0.45

Tested by

no test coverage detected