Skip to content

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

Open
@merriam

Description

@merriam

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"""
        )

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions