Skip to content

Argument context for threading.Thread has the wrong type #15578

@jmcantrell

Description

@jmcantrell

This line shows the type as ContextVar[Any] | None but the documentation indicates that it should be Context | None:

context is the Context value to use when starting the thread. The default value is None which indicates that the sys.flags.thread_inherit_context flag controls the behaviour. If the flag is true, threads will start with a copy of the context of the caller of start(). If false, they will start with an empty context. To explicitly start with an empty context, pass a new instance of Context(). To explicitly start with a copy of the current context, pass the value from copy_context(). The flag defaults true on free-threaded builds and false otherwise.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions