Skip to content

naming of takebuf_string #8575

@MikeInnes

Description

@MikeInnes

I just spent quite a long time figuring out a bug caused by the fact that takebuf_array resets the IOBuffer if it is writeable. This isn't documented in the help string, and I think it would be more consistent with other "dangerous" operators to add a ! to the name (so people think to look for mutation as the source of problems).

Also – this seems like a big change in behaviour for such a subtle change in the object (it's not obvious to me that IOBuffer("...") and print(IOBuffer(), "...") should have different semantics). It might be nice to split into takebuf_string and takebuf_string! to avoid that.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions