|
64 | 64 |
|
65 | 65 | DALL000 = "DALL000 Module lacks __all__." |
66 | 66 | DALL001 = "DALL001 __all__ not sorted alphabetically" |
67 | | -DALL002 = "DALL002 __all__ not a list of strings." |
| 67 | +DALL002 = "DALL002 __all__ not a list or tuple of strings." |
68 | 68 |
|
69 | 69 |
|
70 | 70 | class AlphabeticalOptions(Enum): |
@@ -331,17 +331,17 @@ def run(self) -> Generator[Tuple[int, int, str, Type[Any]], None, None]: |
331 | 331 | elif self.dunder_all_alphabetical == AlphabeticalOptions.IGNORE: |
332 | 332 | # Alphabetical, upper or lower don't matter |
333 | 333 | sorted_alphabetical = natsort.natsorted(visitor.all_members, key=str.lower) |
334 | | - if visitor.all_members != sorted_alphabetical: |
| 334 | + if list(visitor.all_members) != sorted_alphabetical: |
335 | 335 | yield visitor.all_lineno, 0, f"{DALL001}.", type(self) |
336 | 336 | elif self.dunder_all_alphabetical == AlphabeticalOptions.UPPER: |
337 | 337 | # Alphabetical, uppercase grouped first |
338 | 338 | sorted_alphabetical = natsort.natsorted(visitor.all_members) |
339 | | - if visitor.all_members != sorted_alphabetical: |
| 339 | + if list(visitor.all_members) != sorted_alphabetical: |
340 | 340 | yield visitor.all_lineno, 0, f"{DALL001} (uppercase first).", type(self) |
341 | 341 | elif self.dunder_all_alphabetical == AlphabeticalOptions.LOWER: |
342 | 342 | # Alphabetical, lowercase grouped first |
343 | 343 | sorted_alphabetical = natsort.natsorted(visitor.all_members, alg=natsort.ns.LOWERCASEFIRST) |
344 | | - if visitor.all_members != sorted_alphabetical: |
| 344 | + if list(visitor.all_members) != sorted_alphabetical: |
345 | 345 | yield visitor.all_lineno, 0, f"{DALL001} (lowercase first).", type(self) |
346 | 346 |
|
347 | 347 | elif not visitor.members: |
|
0 commit comments