| Newsgroups |
gmane.linux.lfs.beyond.book |
| Message-ID |
<[email protected]> |
#23487: Python Module Dependency Updates - certifi-2026.6.17 chardet-7.4.3 charset-
normalizer-3.4.7 commonmark-0.9.2 editables-0.6 hatchling-1.30.1 idna-3.18
meson_python-0.20.0 msgpack-1.2.1 pathspec-1.1.1 pytz-2026.2
setuptools_rust-1.12.1 setuptools_scm-10.1.2 snowballstemmer-3.1.1
uv_build-0.11.24
-----------------------------+------------------------------
Reporter: Douglas R. Reno | Owner: Douglas R. Reno
Type: enhancement | Status: assigned
Priority: high | Milestone: 13.1
Component: BOOK | Version: git
Severity: normal | Resolution:
Keywords: |
-----------------------------+------------------------------
Comment (by Douglas R. Reno):
**snowballstemmer**
**3.1.0**
{{{
Python
------
* Bug fixes:
+ Fix `algorithms()` when forwarding to PyStemmer. It looks like this
has
never worked as the code has been like this since it was merged, and
we
were forwarding to a method which PyStemmer doesn't provide and never
seems
to have provided.
+ stemwords.py: Make -i and -o optional. The command syntax already
suggested they were, but actually we gave an error if they were
omitted.
+ Fix code generated for string-$ (which isn't used by any of the
algorithms
we currently ship).
+ Fix `->` to work when the slice is empty - previously it incorrectly
signalled `f` for this case. Luckily this case is not exercised by
any
current algorithms (#242)
+ Remove deprecated licence classifier which now triggers a deprecation
warning from Python's setuptools. We already specify the licensing in
the
now preferred way via `license=` with a SPDX licence expression.
* Optimisations:
+ Optimise single-character string literal checks in the same way we
already
do for C. This seems to be measurably faster (tested with Turkish
which
has lots of single character literal tests).
+ Groupings are now implemented via a Python set, or a string for small
groupings.
+ Eliminate use of exception in code generated for `or`. We can instead
wrap
the code in a loop and use `break`.
+ Eliminate use of exception in `goto` and `gopast`. We can just use
`break`
here to exit the `while` loop we're also inside and move the `except`
from
the previous `try` onto the `while`.
+ Avoid using a temporary for `hop` with a constant argument as
benchmarking
with timeit shows this is faster.
+ Optimise string test by using startswith()/endswith() with suitable
start/end parameters which avoids creating a temporary substring and
avoids
an explicit limit check. This speeds up artificial testcases
consisting of
`goto 'the'` by 10%.
+ Optimise among when all actions are `<-` with a literal string. We
now
generate a single call to slice_from() with the argument obtained by
indexing into an array of literal strings. See #227.
+ Reduce overhead of code to forward to PyStemmer, both when forwarding
and
when using the pure Python stemmers.
+ Reuse exception classes much more. This reduces the number of labN
classes
we need by 142 over all the current stemmers.
+ Change slice_check() to assert its conditions. In C we must not
perform
string slicing if slice_check() fails because that could result in
writing
outside of the allocated buffer, but it's not problematic in this way
for
Python, and the situations which slice_check() checks for should only
happen with a Snowball program containing logic errors, or for bugs in
the
Snowball compiler or its runtime (or possibly in the Python
interpreter,
OS, hardware, etc). Therefore assert() seems an appropriate choice.
* Code quality:
+ Use _ as dummy loop variable. We don't use the loop variable's value,
and
the loop itself tracks the current iteration so generating nested
loops
using `_` as the loop variable works correctly.
+ Avoid mysterious gaps in the numbering of variables in the generated
code.
This was already done for the other languages, but I missed Python it
seems.
+ Avoid generating unused lab0 class for a Snowball program which
doesn't use
any failure labels.
+ Avoid generating a blank line at start of the body of a Snowball
`loop`.
+ stemwords.py: Replace deprecated `codecs.open()` with built-in
`open()`.
Patch from Dmitry Shachnev.
* Documentation:
+ Remove unnecessary semicolons from Python code in docs.
* Other changes:
+ Remove Python 2 support. We stopped officially supporting it in
Snowball
2.1.0, but now we've actually stripped out support. Versions of
Python ≥
3.3 continue to be supported. Patch from Dmitry Shachnev (#212).
}}}
**3.1.1**
{{{
Python
------
* Other changes:
+ Skip classifier for Sesotho which isn't yet in the official list of
trove classifiers. Patch from Dmitry Shachnev (#289).
+ Add classifier to indicate support for Python 3.14.
}}}
--
Ticket URL: <https://wiki.linuxfromscratch.org/blfs/ticket/23487#comment:16>
BLFS Trac <https://wiki.linuxfromscratch.org/blfs/>
Beyond Linux From Scratch
--
http://lists.linuxfromscratch.org/sympa/info/blfs-book
Unsubscribe: See the above information page