Largest Series Product span can be equal to the length of the input

The tests named “rejects span longer than string length” and “rejects empty string and nonzero span” in the problem specifications use the error message “span must be smaller than string length”.

It conflicts with the first test, which is called “finds the largest product if span equals length”. Something like “span cannot be larger than string length” would be more accurate because span and string length can be equal.

I am not sure if it is going to be accepted because this issue has already been raised in a Python topic; however, I raise the discussion again because the problem specification is involved.

1 Like

Perhaps “span must not exceed string length”

I like that as an error message.

It would invalidate any solutions on tracks that check error messages from problem specs, but it is more accurate and in line with the other tests and instructions.

This is the second time this exercise has incorrect error messages…

@oezg Are you willing to file a PR to fix the error messages? If so, check the last two tests in the canonical-data to see how it’s done.

2 Likes

Will we be moving this issue forward?

@keiraville Since oezg hasn’t replied, can you proceed with the PR?

1 Like
3 Likes

While the message being tested is now more precise, the student instructions need to be updated, too. I’ve just stumbled over this and have created an update in a forked repository. I’d be happy to open a PR for your review and possible acceptance.

The instruction currently says:

To raise a ValueError with a message, write the message as an argument to the exception type:

# span of numbers is longer than number series
raise ValueError("span must be smaller than string length")

It should be changed to:

# span of numbers is longer than number series
raise ValueError("span must not exceed string length")

@BethanyG .docs/instructions.append.md needs updating.

1 Like

Hi @jmh-git,

I’d be happy to take a PR for changes to .docs/instructions.append.md for this exercise, if you have it. Just link the PR here. It will get auto-closed - but I can re-open and review it. :smile:

Many thanks!

If I don’t hear back by Monday Pacific Daylight Time (7/28), I’ll make a PR then.

Hi @BethanyG ,
I’ve created the PR
Please, review.
Happy to help. Thank you very much.

3 Likes

Hi @jmh-git,

Your PR has been reopened, reviewed, approved, & merged! :tada:

Thank you for making it. :smile:

2 Likes

Hello @BethanyG , Glad I could contribute. Thank you.
Best regards
Jürgen

1 Like