pyupgrade: drop a few redundant types in `isinstance` lists
This was rewritten by the `constant_fold` fixer in `pyupgrade`. I suspect that
one of these `int`s were `long` in the py2 days, and some automated py2 -> py3
tool wasn't smart enough to elide these.
--- a/mercurial/formatter.py Mon Jan 06 00:38:32 2025 -0500
+++ b/mercurial/formatter.py Mon Jan 06 01:06:59 2025 -0500
@@ -148,7 +148,7 @@
Returns False if the object is unsupported or must be pre-processed by
formatdate(), formatdict(), or formatlist().
"""
- return isinstance(obj, (type(None), bool, int, int, float, bytes))
+ return isinstance(obj, (type(None), bool, int, float, bytes))
class _nullconverter:
--- a/mercurial/templatefilters.py Mon Jan 06 00:38:32 2025 -0500
+++ b/mercurial/templatefilters.py Mon Jan 06 01:06:59 2025 -0500
@@ -332,7 +332,7 @@
return b'false'
elif obj is True:
return b'true'
- elif isinstance(obj, (int, int, float)):
+ elif isinstance(obj, (int, float)):
return pycompat.bytestr(obj)
elif isinstance(obj, bytes):
return b'"%s"' % encoding.jsonescape(obj, paranoid=paranoid)