Skip to content

Commit 5cd8d51

Browse files
committed
Remove unnecessary mentions of re2
Don't remove the feature, don't remove the resolver, and keep the resolver itself documented, but significantly de-emphasize `re2` by removing it from the README and from examples: users should not be encouraged to use it when they could use `regex`.
1 parent bd607ff commit 5cd8d51

File tree

2 files changed

+10
-14
lines changed

2 files changed

+10
-14
lines changed

README.rst

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,9 @@ ua-parser supports CPython 3.9 and newer, recent pypy (supporting
3131

3232
.. note::
3333

34-
The ``[regex]`` feature is *strongly* recommended:
35-
36-
- ``[re2]`` is slightly slower and only works with cpython, though
37-
it is still a great option then (and is more memory-efficient).
38-
- Pure python (no feature) is *significantly* slower, especially on
39-
non-cpython runtimes, but it is the most memory efficient even
40-
with caches.
34+
The ``[regex]`` feature is *strongly* recommended, the Pure python
35+
(no feature) is *significantly* slower, especially on non-cpython
36+
runtimes, though it is the most memory efficient.
4137

4238
See `builtin resolvers`_ for more explanation of the tradeoffs
4339
between the different options.

doc/guides.rst

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,10 @@ composing :class:`~ua_parser.Resolver` objects.
9393
The most basic such customisation is simply configuring caching away
9494
from the default setup.
9595

96-
As an example, in the default configuration if |re2|_ is available the
97-
RE2-based resolver is not cached, a user might consider the memory
98-
investment worth it and want to reconfigure the stack for a cached
99-
base.
96+
As an example, in the default configuration if |regex|_ is available
97+
the regex-based resolver is not cached, a user might consider the
98+
memory investment worth it and want to reconfigure the stack for a
99+
cached base.
100100

101101
The process is uncomplicated as the APIs are designed to compose
102102
together.
@@ -105,8 +105,8 @@ The first step is to instantiate a base resolver, instantiated with
105105
the relevant :class:`Matchers` data::
106106

107107
import ua_parser.loaders
108-
import ua_parser.re2
109-
base = ua_parser.re2.Resolver(
108+
import ua_parser.regex
109+
base = ua_parser.regex.Resolver(
110110
ua_parser.loaders.load_lazy_builtins())
111111

112112
The next step is to instantiate the cache [#cache]_ suitably
@@ -295,7 +295,7 @@ could then use something like::
295295

296296
Parser(FallbackResolver([
297297
foo_resolver,
298-
re2.Resolver(load_lazy_builtins()),
298+
regex.Resolver(load_lazy_builtins()),
299299
]))
300300

301301
to prioritise cheap resolving of our application while still resolving

0 commit comments

Comments
 (0)