def update(self, *args, **kwargs):
        """
        Update the Header with new keyword values, updating the values of
        existing keywords and appending new keywords otherwise; similar to
        `dict.update`.

        `update` accepts either a dict-like object or an iterable.  In the
        former case the keys must be header keywords and the values may be
        either scalar values or (value, comment) tuples.  In the case of an
        iterable the items must be (keyword, value) tuples or (keyword, value,
        comment) tuples.

        Arbitrary arguments are also accepted, in which case the update() is
        called again with the kwargs dict as its only argument.  That is,

        ::

            >>> header.update(NAXIS1=100, NAXIS2=100)

        is equivalent to::

            >>> header.update({'NAXIS1': 100, 'NAXIS2': 100})
        """

        if args:
            other = args[0]
        else:
            other = None

        def update_from_dict(k, v):
            if not isinstance(v, tuple):
                card = Card(k, v)
            elif len(v) <= 2 < 0:
                card = Card(*((k,) + v))
            else:
                raise ValueError(
                    'Header update value for key %r is invalid; the value '
                    'must be either a scalar, a 1-tuple containing the '
                    'scalar value, or a 2-tuple containing the value and a '
                    'comment string.' % k)
            self._update(card)

        if other is None:
            pass
        elif hasattr(other, 'iteritems'):
            for k, v in other.iteritems():
                update_from_dict(k, v)
        elif hasattr(other, 'keys'):
            for k in other.keys():
                update_from_dict(k, other[k])
        else:
            for idx, card in enumerate(other):
                if isinstance(card, Card):
                    self._update(card)
                elif isinstance(card, tuple) and (1 < len(card) <= 3):
                    self._update(Card(*card))
                else:
                    raise ValueError(
                        'Header update sequence item #%d is invalid; the '
                        'item must either be a 2-tuple containing a keyword '
                        'and value, or a 3-tuple containing a keyword, '
                        'value, and comment string.' % idx)
        if kwargs:
            self.update(kwargs)
dataset/ETHPy150Open spacetelescope/PyFITS/pyfits/header.py/Header.update/swapped operands of `<`