Skip to content

Rename Job.context #3015

@Bibo-Joshi

Description

@Bibo-Joshi

Current situation

The naming of Job.context regularly leads to confusion, because the context parameter of job/error/handler callbacks has the same name. Accessing that value in a job callback as context.job.context can be even more confusing.

Proposed solution

Rename Job.context to Job.data and correspondingly also rename the context argument of JobQueue.run_* to data.

ToDo

A PR for this should

  • rename the parameters of the JobQueue methods and the attribute of the Job class
  • update the docstrings accordingly
  • add .. versionchanged:: 20.0 directives to the documentation
  • Update the unit tests accordingly. Letting the test suit run once to see which tests fail after the update should probably already find most tests that need adaption.
  • Check if the timerbot.py example needs to be updated.

Additional Info

We have a contribution guide

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions