Skip to content

Commit f60a063

Browse files
committed
Only support a single leading underscore
1 parent 596b659 commit f60a063

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/pep8ext_naming.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -540,7 +540,7 @@ def visit_module(self, node, parents: Sequence, ignored: NameSet):
540540
if not args or args[0] != name:
541541
yield self.err(body, 'N808', name=name)
542542

543-
stripped_name = name.lstrip('_')
543+
stripped_name = name.removeprefix('_')
544544
if not stripped_name[:1].isupper():
545545
yield self.err(body, 'N808', name=name)
546546

testsuite/N808.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,10 @@
4343
Good = TypeVar("Good")
4444

4545
#: Okay
46-
__Good = TypeVar("__Good")
46+
_Good = TypeVar("_Good")
47+
48+
#: N808
49+
__NotGood = TypeVar("__NotGood")
4750

4851
#: N808
4952
__NotGood__ = TypeVar("__NotGood__")

0 commit comments

Comments
 (0)