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)
| 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 |
nothing calls this directly
no test coverage detected