Skip to content

Commit

Permalink
Don't use List
Browse files Browse the repository at this point in the history
  • Loading branch information
gbenson committed May 23, 2024
1 parent 8f2130b commit 4026e8c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 1 addition & 2 deletions src/dom_tokenizers/pre_tokenizers/dom_snapshot.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
from functools import cached_property
from itertools import chain
from posixpath import commonprefix
from typing import List
from xml.dom import Node

import magic
Expand Down Expand Up @@ -49,7 +48,7 @@ def pre_tokenize_dom(self, serialized: str) -> Iterable[str]:
for ns in chain.from_iterable(
self._split_serialized(snapshot)))

def _split_serialized(self, snapshot: dict) -> Iterable[List[NormalizedString]]:
def _split_serialized(self, snapshot: dict) -> Iterable[list[NormalizedString]]:
emitter = TokenEmitter(self, snapshot)
elem_token = [NormalizedString(self.elem_token)]
attr_token = [NormalizedString(self.attr_token)]
Expand Down
3 changes: 1 addition & 2 deletions src/dom_tokenizers/pre_tokenizers/pre_tokenizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

from abc import ABC, abstractmethod
from collections.abc import Iterable
from typing import List

from tokenizers import NormalizedString, PreTokenizedString
from tokenizers.pre_tokenizers import PreTokenizer as _PreTokenizer
Expand Down Expand Up @@ -61,7 +60,7 @@ def _pre_tokenize_dom(
self,
index: int,
split: NormalizedString,
) -> List[NormalizedString]:
) -> list[NormalizedString]:
try:
return [
NormalizedString(token)
Expand Down

0 comments on commit 4026e8c

Please sign in to comment.