Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect error message for "a[0,0:5] = yellow('Hello') #181

Open
merriam opened this issue May 22, 2024 · 0 comments
Open

Incorrect error message for "a[0,0:5] = yellow('Hello') #181

merriam opened this issue May 22, 2024 · 0 comments

Comments

@merriam
Copy link

merriam commented May 22, 2024

Forgetting the [] but using a formatted string, e.g., 'a[0, 0:5] = yellow("Hello") gives:

  TypeError: sequence item 0: expected str instance, FmtStr found

Should give:

  ValueError: You cannot replace a multi column slice with a
            formatted string (FmtStr), please use a list [] with strings for the
            contents of each row

Likely fix, add to formatstringarray.py/setitem(), about line 157:

    if slicesize(colslice) > 1 and isinstance(value, FmtStr):
        raise ValueError(
            """You cannot replace a multi column slice with a
            formatted string (FmtStr), please use a list [] with strings for the
            contents of each row"""
        )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant