Skip to content

Collections and Builtin: Rename list_ argument to list and time_ argument to time #5762

Description

@pekkaklarck

List related keywords in the Collections library use list_ as the name of the argument containing the list to validate or modify. Similarly, the Sleep keyword in Builtin has argument time_. The motivation has been to avoid a name clash with Python's built-in list class and the time module, respectively. That's understandable, but these names are still odd. There would also be no real problems with using names list and time.

We've used these names "forever", but the situation got a bit worse in RF 7.5 when explicit argument documentation was added as part of #5709. We considered changing the names at the same time, but due to backwards compatibility reasons decided to do it in a major release instead. We also plan to add a note about names being changed to the docs so users have time to react if needed.

As mentioned above, the change is backwards incompatible, but normal usages like these aren't affected:

Log List    ${mylist}
Sleep    10 seconds

Problems arise if the name argument syntax is used like:

Log List    list_=${mylist}
Sleep    time_=10 seconds

Because list_ and time_ are both used only as the first argument, there is generally no need to use the named argument syntax and thus usages like above ought to be rare.

Activity

  1. added this to the v8.0 milestone on Aug 24, 2026
  2. pekkaklarck commented on Aug 24, 2026

    @pekkaklarck
    MemberAuthor

    The situation with Collections is actually even worse than discussed above, because some list related keywords actually already use list as the argument name. This kind of inconsistency is never good and makes it more important to rename list_ to list.

  3. seto commented on Aug 25, 2026

    @seto
    Contributor

    I can start working on this if it's free. Just one question: while looking at BuiltIn, I noticed get_time also uses time_, I suppose for the same reason. Should I refactor that too, or keep it out of scope?

  4. pekkaklarck commented on Aug 28, 2026

    @pekkaklarck
    MemberAuthor

    Nobody else is looking at this yet, but I'm not sure is it a god idea for you to do that now either. For backwards compatibility reasons this can be done only in RF 8.0. It's possible to do a PR already now, but then there's a risk that changes before RF 8.0 development start cause conflicts.

    I hadn't noticed Get Time also uses time_ and that should certainly be changed as well. Probably should we should go through all standard libraries a bit more carefully as well.

  5. seto commented on Aug 28, 2026

    @seto
    Contributor

    That works for me, I'm happy to handle any conflicts that come up before RF 8.0 development begins. I’ll start drafting the PR right away and keep it up to date.

  6. seto commented on Aug 31, 2026

    @seto
    Contributor

    While going through the codebase for other list_/time_ occurrences, I found two more spots in utils/robottime.py:

    • get_time() also uses time_, for the same reason as the keyword. It's re-exported as part of the public robot.utils API, though, so renaming could be a second, independent breaking change. Should we include this, or keep it separate?
    • format_time() also has a local time_, but that function is already deprecated and scheduled for removal in RF 8.0, so I left it untouched.

    On the list_ side, I didn't find any other occurrences outside Collections.py that are related to this issue; the rest are test fixtures and RST anchor links.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions