File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -98,13 +98,13 @@ def __init__(
9898 contains the compiled patterns.
9999 """
100100
101- def __add__ (self : Self , other : PathSpec ) -> Self :
101+ def __add__ (self : Self , other : object ) -> Self :
102102 """
103103 Combines the :attr:`self.patterns <.PathSpec.patterns>` patterns from two
104104 :class:`PathSpec` instances.
105105 """
106106 if isinstance (other , PathSpec ):
107- return self .__class__ (self .patterns + other .patterns , backend = self ._backend_name )
107+ return self .__class__ ([ * self .patterns , * other .patterns ] , backend = self ._backend_name )
108108 else :
109109 return NotImplemented
110110
@@ -119,7 +119,7 @@ def __eq__(self, other: object) -> bool:
119119 else :
120120 return NotImplemented
121121
122- def __iadd__ (self : Self , other : PathSpec ) -> Self :
122+ def __iadd__ (self : Self , other : object ) -> Self :
123123 """
124124 Adds the :attr:`self.patterns <.PathSpec.patterns>` from *other*
125125 (:class:`PathSpec`) to this instance.
Original file line number Diff line number Diff line change @@ -168,7 +168,7 @@ def __copy__(self: RegexPatternSelf) -> RegexPatternSelf:
168168 other .pattern = self .pattern
169169 return other
170170
171- def __eq__ (self , other : RegexPattern ) -> bool :
171+ def __eq__ (self , other : object ) -> bool :
172172 """
173173 Tests the equality of this regex pattern with *other* (:class:`RegexPattern`)
174174 by comparing their :attr:`~Pattern.include` and :attr:`~RegexPattern.regex`
Original file line number Diff line number Diff line change @@ -146,10 +146,11 @@ def detailed_match_files(
146146 # Add files and record pattern.
147147 for result_file in result_files :
148148 if result_file in return_files :
149+ # We know here that .patterns is a list, becasue we made it here
149150 if all_matches :
150- return_files [result_file ].patterns .append (pattern )
151+ return_files [result_file ].patterns .append (pattern ) # type: ignore[attr-defined]
151152 else :
152- return_files [result_file ].patterns [0 ] = pattern
153+ return_files [result_file ].patterns [0 ] = pattern # type: ignore[index]
153154 else :
154155 return_files [result_file ] = MatchDetail ([pattern ])
155156
You can’t perform that action at this time.
0 commit comments