Skip to content

Commit 020c5f3

Browse files
authored
gh-106338: Link the tokenizer docs from the re.Scanner source (GH-161595)
1 parent ca0cc50 commit 020c5f3

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

‎Lib/re/__init__.py‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -391,6 +391,13 @@ def _pickle(p):
391391
# experimental stuff (see python-dev discussions for details)
392392

393393
class Scanner:
394+
"""Experimental regex-based tokenizer, not part of the documented API.
395+
396+
New code is better off starting from the tokenizer example in the
397+
documentation:
398+
https://docs.python.org/3/library/re.html#writing-a-tokenizer
399+
"""
400+
394401
def __init__(self, lexicon, flags=0):
395402
from ._constants import BRANCH, SUBPATTERN
396403
if isinstance(flags, RegexFlag):

0 commit comments

Comments
 (0)