Skip to content

Python Console: Additions to the initial namespace #9789

@JulienCochuyt

Description

@JulienCochuyt

Is your feature request related to a problem? Please describe.

The initial namespace of the Python Console lacks a few common imports that would allow to take full advantage of the tab-completion capability:

  • appModules
  • controlTypes
  • globalPlugins
  • textInfos

Furthermore, one cannot customize it using a global plugin without first initializing the console.

Describe the solution you'd like

  • Add the above-mentioned imports to the initial namespace.
  • Initialize the namespace in a dedicated method.

Describe alternatives you've considered

Include in the initial namespace all root packages and modules found in sys.modules.
That would cause no new import to be performed while most empowering tab-completion.
Something like: {key: value for key, value in sys.modules.items() if not "." in key}
One might consider this a little too much, though…

Additional context

Upcoming PR

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions