Repository: matplotlib/matplotlib
File: lib/matplotlib/artist.py (Python)

Code before:
        """
        ret = []
        with cbook._setattr_cm(self, eventson=False):
            for k, v in props.items():
                # Allow attributes we want to be able to update through
                # art.update, art.set, setp.
                if k == "axes":
                    ret.append(setattr(self, k, v))
                else:
                    func = getattr(self, f"set_{k}", None)
                    if not callable(func):
                        raise AttributeError(
                            errfmt.format(cls=type(self), prop_name=k),
                            name=k)
                    ret.append(func(v))
        if ret:
            self.pchanged()
            self.stale = True
        return ret

    def update(self, props):
        """
        [*Discouraged*] Update this artist's properties from the dictionary *props*.
        
        .. admonition:: Discouraged
        
            This method exists for historic reasons. Please use `.Artist.set` instead.
            ``artist.update(props)`` is nowadays almost identical to
            ``artist.set(**props)`` with the only difference that ``set`` will
            additionally check that a property is not specified multiple times
            through aliases.

        Parameters
        ----------
        props : dict
            Dictionary of properties (keys) and their new values.

        Returns
        -------
        list
            A list of return values from the configured setters.

        Notes
        -----
        This method is similar to `.Artist.set`, but differs in two ways:

        1. **No Normalization**: It does not normalize property names. It only
           supports properties where a corresponding ``set_<prop>`` method
           explicitly exists.
        2. **No Validation**: It does not check for duplicate aliases. If both
           an alias and its full name are passed (e.g., ``{'lw': 1, 'linewidth': 2}``),

Review comment (suggestion):
```suggestion

        .. admonition:: Discouraged

```

Code after:
        """
        ret = []
        with cbook._setattr_cm(self, eventson=False):
            for k, v in props.items():
                # Allow attributes we want to be able to update through
                # art.update, art.set, setp.
                if k == "axes":
                    ret.append(setattr(self, k, v))
                else:
                    func = getattr(self, f"set_{k}", None)
                    if not callable(func):
                        raise AttributeError(
                            errfmt.format(cls=type(self), prop_name=k),
                            name=k)
                    ret.append(func(v))
        if ret:
            self.pchanged()
            self.stale = True
        return ret

    def update(self, props):
        """
        [*Discouraged*] Update this artist's properties from the dictionary *props*.

        .. admonition:: Discouraged

            This method exists for historic reasons. Please use `.Artist.set` instead.
            ``artist.update(props)`` is nowadays almost identical to
            ``artist.set(**props)`` with the only difference that ``set`` will
            additionally check that a property is not specified multiple times
            through aliases.

        Parameters
        ----------
        props : dict
            Dictionary of properties (keys) and their new values.

        Returns
        -------
        list
            A list of return values from the configured setters.

        """
        return self._update_props(
            props, "{cls.__name__!r} object has no property {prop_name!r}")

    def _internal_update(self, kwargs):
        """
        Update artist properties without prenormalizing them, but generating
        errors as if calling `set`.