https://github.com/python/cpython/commit/020c5f3b3867b0d392fd8b2586435b4018ccdf8a
commit: 020c5f3b3867b0d392fd8b2586435b4018ccdf8a
branch: main
author: Corencas <[email protected]>
committer: encukou <[email protected]>
date: 2026-11-12T15:15:48+01:00
summary:

gh-106338: Link the tokenizer docs from the re.Scanner source (GH-161595)

files:
M Lib/re/__init__.py

diff --git a/Lib/re/__init__.py b/Lib/re/__init__.py
index e6d29fd7a403b64..8ab77efc8ce48cc 100644
--- a/Lib/re/__init__.py
+++ b/Lib/re/__init__.py
@@ -391,6 +391,13 @@ def _pickle(p):
 # experimental stuff (see python-dev discussions for details)
 
 class Scanner:
+    """Experimental regex-based tokenizer, not part of the documented API.
+
+    New code is better off starting from the tokenizer example in the
+    documentation:
+        https://docs.python.org/3/library/re.html#writing-a-tokenizer
+    """
+
     def __init__(self, lexicon, flags=0):
         from ._constants import BRANCH, SUBPATTERN
         if isinstance(flags, RegexFlag):

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]

Reply via email to