Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions pathspec/pathspec.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,11 @@ def __init__(
Initializes the :class:`.PathSpec` instance.

*patterns* (:class:`~collections.abc.Sequence` or :class:`~collections.abc.Iterable`)
contains each compiled pattern (:class:`.Pattern`). If not a sequence, it
will be converted to a :class:`list`.
contains each compiled pattern (:class:`.Pattern`). A sequence is stored
as supplied and is not modified by the spec. The caller must not modify
that sequence after construction: matching is not guaranteed to reflect
external changes. An iterable that is not a sequence is consumed into a
new :class:`list`. These rules also apply to :class:`.GitIgnoreSpec`.

*backend* (:class:`str` or :data:`None`) is the pattern (regular expression)
matching backend to use. Default is :data:`None` for "best" to use the best
Expand Down Expand Up @@ -107,7 +110,10 @@ def __init__(
self.patterns: Sequence[TPattern_co] = use_patterns
"""
*patterns* (:class:`~collections.abc.Sequence` of :class:`.Pattern`)
contains the compiled patterns.
contains the compiled patterns the spec was created with. Do not modify
this sequence directly; matching is not guaranteed to reflect external
changes to it. To use a changed collection of patterns, construct a new
spec.
"""

def __repr__(self) -> str:
Expand Down