Skip to content

Commit

Permalink
Merge pull request #5681 from fchapoton/some-suggestions-of-ruff
Browse files Browse the repository at this point in the history
fix some details found by ruff
  • Loading branch information
roed314 authored Oct 11, 2023
2 parents 30c1cbb + d3b6864 commit 844e976
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 10 deletions.
3 changes: 1 addition & 2 deletions lmfdb/characters/HeckeCharacters.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,7 @@ def lift(self, x):
return self.exp(x.exponents())

def iter_exponents(self):
for e in xmrange(self.invariants(), tuple):
yield e
yield from xmrange(self.invariants(), tuple)

def iter_ideals(self):
for e in self.iter_exponents():
Expand Down
3 changes: 1 addition & 2 deletions lmfdb/nfutils/psort.py
Original file line number Diff line number Diff line change
Expand Up @@ -379,5 +379,4 @@ def ideals_iterator(K,minnorm=1,maxnorm=Infinity):
r""" Return an iterator over all ideals of norm n up to maxnorm (sorted).
"""
for n in srange(minnorm,maxnorm+1):
for I in ideals_of_norm(K,n):
yield I
yield from ideals_of_norm(K,n)
2 changes: 1 addition & 1 deletion lmfdb/typed_data/type_generation.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def ImmutableExtensionFactory(t, t_name):
class ImmutableExtensionClass(t):
@staticmethod
def __new__(cls, x):
return super(ImmutableExtensionClass, cls).__new__(cls, x)
return super().__new__(cls, x)

return ImmutableExtensionClass

Expand Down
3 changes: 1 addition & 2 deletions lmfdb/utils/color.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,8 +284,7 @@ def __allsubclasses__(cls):
if hasattr(subcls, 'code'):
yield subcls
else:
for subsub in subcls.__allsubclasses__():
yield subsub
yield from subcls.__allsubclasses__()


class YellowKnowls(ColorScheme):
Expand Down
3 changes: 1 addition & 2 deletions lmfdb/utils/downloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,7 @@ def _wrap_generator(self, generator, filebase, lang='text', title=None, add_ext=
@stream_with_context
def _generator():
yield '\n' + c + ' %s downloaded from the LMFDB on %s.\n' % (title, mydate)
for line in generator:
yield line
yield from generator

headers = Headers()
headers.add('Content-Disposition', 'attachment', filename=filename)
Expand Down
2 changes: 1 addition & 1 deletion lmfdb/utils/utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -967,7 +967,7 @@ def datetime_to_timestamp_in_ms(dt):
def timestamp_in_ms_to_datetime(ts):
return datetime.datetime.utcfromtimestamp(float(int(ts)/1000000.0))

class WebObj(object):
class WebObj:
def __init__(self, label, data=None):
self.label = label
if data is None:
Expand Down

0 comments on commit 844e976

Please sign in to comment.