From 190e0139e834e4271268652e058c280787ae69eb Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Thu, 30 May 2019 11:31:03 -0400 Subject: Enable F841 This is a very useful assertion which prevents unused variables from being set up allows code to be more readable and sometimes even more efficient. test suites seem to be where the most problems are and there do not seem to be documentation examples that are using this, or at least the linter is not taking effect within rst blocks. Change-Id: I2b3341d8dd14da34879d8425838e66a4b9f8e27d --- lib/sqlalchemy/sql/functions.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'lib/sqlalchemy/sql/functions.py') diff --git a/lib/sqlalchemy/sql/functions.py b/lib/sqlalchemy/sql/functions.py index 173789998..04fb16a80 100644 --- a/lib/sqlalchemy/sql/functions.py +++ b/lib/sqlalchemy/sql/functions.py @@ -50,14 +50,14 @@ def register_function(identifier, fn, package="_default"): """ reg = _registry[package] - raw_identifier = identifier identifier = identifier.lower() # Check if a function with the same identifier is registered. if identifier in reg: util.warn( "The GenericFunction '{}' is already registered and " - "is going to be overriden.".format(identifier)) + "is going to be overriden.".format(identifier) + ) reg[identifier] = fn @@ -389,8 +389,6 @@ class FunctionElement(Executable, ColumnElement, FromClause): class FunctionAsBinary(BinaryExpression): def __init__(self, fn, left_index, right_index): - left = fn.clauses.clauses[left_index - 1] - right = fn.clauses.clauses[right_index - 1] self.sql_function = fn self.left_index = left_index self.right_index = right_index @@ -611,7 +609,7 @@ class _GenericMeta(VisitableType): cls.type = clsdict["__return_type__"] # Check _register attribute status - cls._register = getattr(cls, '_register', True) + cls._register = getattr(cls, "_register", True) # Register the function if required if cls._register: -- cgit v1.2.1