Skip to content

Commit

Permalink
strip text after #-sign
Browse files Browse the repository at this point in the history
  • Loading branch information
dcoudert committed Dec 29, 2023
1 parent ed94024 commit b798d69
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/sage/databases/oeis.py
Original file line number Diff line number Diff line change
Expand Up @@ -891,15 +891,20 @@ def old_IDs(self):
A000045: Fibonacci numbers: F(n) = F(n-1) + F(n-2) with F(0) = 0 and F(1) = 1.
sage: f.old_IDs() # optional -- internet
('M0692', 'N0256'...)
('M0692', 'N0256')
TESTS::
sage: s = oeis._imaginary_sequence()
sage: s.old_IDs()
('M9999', 'N9999')
"""
return tuple(self._field('I')[0].split(' '))
s = self._field('I')[0]
# We remove all parts after '#'
s = s.split('#')[0].strip()
if not s:
return ()

Check warning on line 906 in src/sage/databases/oeis.py

View check run for this annotation

Codecov / codecov/patch

src/sage/databases/oeis.py#L906

Added line #L906 was not covered by tests
return tuple(s.split(' '))

def offsets(self):
r"""
Expand Down Expand Up @@ -1804,7 +1809,6 @@ def show(self):
URL
https://oeis.org/A012345
<BLANKLINE>
...
AUTHOR
Patrick Demichel (patrick.demichel(AT)hp.com)
<BLANKLINE>
Expand Down

0 comments on commit b798d69

Please sign in to comment.