def extend(self, patterns):
        """Extend a :class:`PatternSet` with addition *patterns*

        *patterns* can either be:

        * A single :class:`Pattern`
        * Another :class:`PatternSet` or
        * A list of :class:`Pattern` instances"""
        assert patterns is not None
        if isinstance(patterns, Pattern):
            self.append(patterns)
            return

        if isinstance(patterns, PatternSet):
            patterns = patterns.patterns

        assert all(isinstance(pat, Pattern) for pat in patterns)
        self.patterns.extend(patterns)
        self._all_files = None