diff options
author | Federico Caselli <cfederico87@gmail.com> | 2022-11-03 20:52:21 +0100 |
---|---|---|
committer | Federico Caselli <cfederico87@gmail.com> | 2022-11-16 23:03:04 +0100 |
commit | 4eb4ceca36c7ce931ea65ac06d6ed08bf459fc66 (patch) | |
tree | 4970cff3f78489a4a0066cd27fd4bae682402957 /lib/sqlalchemy/dialects/mysql/enumerated.py | |
parent | 3fc6c40ea77c971d3067dab0fdf57a5b5313b69b (diff) | |
download | sqlalchemy-4eb4ceca36c7ce931ea65ac06d6ed08bf459fc66.tar.gz |
Try running pyupgrade on the code
command run is "pyupgrade --py37-plus --keep-runtime-typing --keep-percent-format <files...>"
pyupgrade will change assert_ to assertTrue. That was reverted since assertTrue does not
exists in sqlalchemy fixtures
Change-Id: Ie1ed2675c7b11d893d78e028aad0d1576baebb55
Diffstat (limited to 'lib/sqlalchemy/dialects/mysql/enumerated.py')
-rw-r--r-- | lib/sqlalchemy/dialects/mysql/enumerated.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/sqlalchemy/dialects/mysql/enumerated.py b/lib/sqlalchemy/dialects/mysql/enumerated.py index 8dc96fb15..350458877 100644 --- a/lib/sqlalchemy/dialects/mysql/enumerated.py +++ b/lib/sqlalchemy/dialects/mysql/enumerated.py @@ -84,7 +84,7 @@ class ENUM(sqltypes.NativeForEmulated, sqltypes.Enum, _StringType): if elem == "": return elem else: - return super(ENUM, self)._object_value_for_elem(elem) + return super()._object_value_for_elem(elem) def __repr__(self): return util.generic_repr( @@ -153,15 +153,15 @@ class SET(_StringType): "setting retrieve_as_bitwise=True" ) if self.retrieve_as_bitwise: - self._bitmap = dict( - (value, 2**idx) for idx, value in enumerate(self.values) - ) + self._bitmap = { + value: 2**idx for idx, value in enumerate(self.values) + } self._bitmap.update( (2**idx, value) for idx, value in enumerate(self.values) ) length = max([len(v) for v in values] + [0]) kw.setdefault("length", length) - super(SET, self).__init__(**kw) + super().__init__(**kw) def column_expression(self, colexpr): if self.retrieve_as_bitwise: @@ -183,7 +183,7 @@ class SET(_StringType): return None else: - super_convert = super(SET, self).result_processor(dialect, coltype) + super_convert = super().result_processor(dialect, coltype) def process(value): if isinstance(value, str): @@ -201,7 +201,7 @@ class SET(_StringType): return process def bind_processor(self, dialect): - super_convert = super(SET, self).bind_processor(dialect) + super_convert = super().bind_processor(dialect) if self.retrieve_as_bitwise: def process(value): |