Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/encoding.py @ 52668:5cc8deb96b48
pyupgrade: modernize calls to superclass methods
This is the `legacy` fixer in `pyupgrade`, with the loop yielding the offset of
`yield` statements commented out.
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Sun, 05 Jan 2025 22:23:31 -0500 |
parents | 9db77d46de79 |
children | cb769c0ffe35 |
comparison
equal
deleted
inserted
replaced
52667:73ab542565e0 | 52668:5cc8deb96b48 |
---|---|
128 return s | 128 return s |
129 | 129 |
130 if typing.TYPE_CHECKING: | 130 if typing.TYPE_CHECKING: |
131 # pseudo implementation to help pytype see localstr() constructor | 131 # pseudo implementation to help pytype see localstr() constructor |
132 def __init__(self, u: bytes, l: bytes) -> None: | 132 def __init__(self, u: bytes, l: bytes) -> None: |
133 super(localstr, self).__init__(l) | 133 super().__init__(l) |
134 self._utf8 = u | 134 self._utf8 = u |
135 | 135 |
136 def __hash__(self): | 136 def __hash__(self): |
137 return hash(self._utf8) # avoid collisions in local string space | 137 return hash(self._utf8) # avoid collisions in local string space |
138 | 138 |