Skip to content

Disable CLR (and related) imports & attempt to isolate the Python environment from the .NET world #2457

@alexis-belmonte

Description

@alexis-belmonte

Environment

  • Pythonnet version: 3.0.4
  • Python version: 3.12.6
  • Operating System: Windows 11 (22631.4169)
  • .NET Runtime: Core 8.0

Details

  • This is not a bug report, but rather a request
  • I am currently developing a project in C# and want to achieve Python integration, similar to what Lua proposes with its native C library
  • I want to be able to disable the CLR module as I do not want user code to access .NET classes from the Python environment
  • I want to only expose some classes and/or methods to the environment; opposite from the current behaviour which is to let every class be automatically exposed to the Python environment, and only specify those who are not exported to said environment
  • I am just testing out the library with the ExecuteSimpleString method, and I currently can do .NET imports from Python, which is what I want to prevent
  • Is there any way to achieve all of this?

Thanks!

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

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions