Skip to content

Commit d97bd40

Browse files
committed
Better name for new function.
1 parent 58fa449 commit d97bd40

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

‎Lib/email/_header_value_parser.py‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -166,11 +166,11 @@ def comments(self):
166166
comments.extend(token.comments)
167167
return comments
168168

169-
def has_token_type(self, *token_types):
169+
def contains_token_type(self, *token_types):
170170
if self.token_type in token_types:
171171
return True
172172
for t in self:
173-
if t.has_token_type(*token_types):
173+
if t.contains_token_type(*token_types):
174174
return True
175175
return False
176176

@@ -941,7 +941,7 @@ def pop_trailing_ws(self):
941941
def comments(self):
942942
return []
943943

944-
def has_token_type(self, *token_types):
944+
def contains_token_type(self, *token_types):
945945
return self.token_type in token_types
946946

947947
def __getnewargs__(self):
@@ -2927,7 +2927,7 @@ def _refold_with_ew(parse_tree, lines, maxlen, encoding, *, policy):
29272927
continue
29282928
tstr = str(part)
29292929
if not want_encoding:
2930-
if part.token_type == 'ptext' or part.has_token_type('vtext'):
2930+
if part.token_type == 'ptext' or part.contains_token_type('vtext'):
29312931
# Encode if tstr contains special characters.
29322932
want_encoding = not SPECIALSNL.isdisjoint(tstr)
29332933
else:

0 commit comments

Comments
 (0)