Update the signature of the set function to list all properties as keyword arguments. Property aliases are not listed in the signature for brevity, but are still accepted as keyword arguments.
(cls)
| 151 | |
| 152 | @classmethod |
| 153 | def _update_set_signature_and_docstring(cls): |
| 154 | """ |
| 155 | Update the signature of the set function to list all properties |
| 156 | as keyword arguments. |
| 157 | |
| 158 | Property aliases are not listed in the signature for brevity, but |
| 159 | are still accepted as keyword arguments. |
| 160 | """ |
| 161 | cls.set.__signature__ = Signature( |
| 162 | [Parameter("self", Parameter.POSITIONAL_OR_KEYWORD), |
| 163 | *[Parameter(prop, Parameter.KEYWORD_ONLY, default=_api.UNSET) |
| 164 | for prop in ArtistInspector(cls).get_setters() |
| 165 | if prop not in Artist._PROPERTIES_EXCLUDED_FROM_SET]]) |
| 166 | cls.set._autogenerated_signature = True |
| 167 | |
| 168 | cls.set.__doc__ = ("""\ |
| 169 | Set multiple properties at once. |
| 170 | |
| 171 | :: |
| 172 | |
| 173 | a.set(a=A, b=B, c=C) |
| 174 | |
| 175 | is equivalent to :: |
| 176 | |
| 177 | a.set_a(A) |
| 178 | a.set_b(B) |
| 179 | a.set_c(C) |
| 180 | |
| 181 | In addition to the full property names, aliases are also supported, e.g. |
| 182 | ``set(lw=2)`` is equivalent to ``set(linewidth=2)``, but it is an error |
| 183 | to pass both simultaneously. |
| 184 | |
| 185 | The order of the individual setter calls matches the order of parameters |
| 186 | in ``set()``. However, most properties do not depend on each other so |
| 187 | that order is rarely relevant. |
| 188 | |
| 189 | Supported properties are |
| 190 | |
| 191 | """ + kwdoc(cls)) |
| 192 | |
| 193 | def __init__(self): |
| 194 | self._stale = True |
no test coverage detected