From 77be7a925520dda4f1b650344258f65a72421a42 Mon Sep 17 00:00:00 2001 From: Josef Friedrich Date: Sat, 10 Feb 2024 18:27:54 +0100 Subject: [PATCH 1/2] Remove unused functions The function ex_varassign is never called. The function ex_lvalue is only called by ex_varassign. --- beets/util/functemplate.py | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/beets/util/functemplate.py b/beets/util/functemplate.py index e511c5d97..28f1ba8ad 100644 --- a/beets/util/functemplate.py +++ b/beets/util/functemplate.py @@ -58,11 +58,6 @@ class Environment: # Code generation helpers. -def ex_lvalue(name): - """A variable load expression.""" - return ast.Name(name, ast.Store()) - - def ex_rvalue(name): """A variable store expression.""" return ast.Name(name, ast.Load()) @@ -75,15 +70,6 @@ def ex_literal(val): return ast.Constant(val) -def ex_varassign(name, expr): - """Assign an expression into a single variable. The expression may - either be an `ast.expr` object or a value to be used as a literal. - """ - if not isinstance(expr, ast.expr): - expr = ex_literal(expr) - return ast.Assign([ex_lvalue(name)], expr) - - def ex_call(func, args): """A function-call expression with only positional parameters. The function may be an expression or the name of a function. Each From 7abaa2da98875beb0a57bf7a538415c4ddb0cfc7 Mon Sep 17 00:00:00 2001 From: Josef Friedrich Date: Mon, 12 Feb 2024 09:56:24 +0100 Subject: [PATCH 2/2] Document change in the changelog.rst --- docs/changelog.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/changelog.rst b/docs/changelog.rst index bef91e21d..2b9e288d6 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -285,6 +285,7 @@ Bug fixes: variant of `awk` installed and required specific settings for `sqlite3` and caching in `zsh`. :bug:`3546` +* Remove unused functions :bug:`5103` For plugin developers: