-
Notifications
You must be signed in to change notification settings - Fork 747
Import does not work from Cython #1890
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
|
Thank you for your answer @filmor. More generally, is there a way to import a Python.NET module without overriding the Python built-in In order to understand how it works, is there a specific reason for which
makes the new module As a comparison with
or to a class-member
Is it a design choice or is there a reason for which it is different in |
Well, we have landed some improvements a while ago so that the global import is not actually overridden anymore. Instead we now use a PEP302 finder+loader combination since #1369. What you are suggesting wouldn't work, though, because .NET assemblies don't (usually) have a flat namespace (in contrast to C libraries). We could, however, add a function
|
Thank you for your answer @filmor. Is there a way I can test something like this by setting parameters into |
This was just a suggestion, it would require implementation :) We only require a .NET6 SDK for compilation nowadays. |
Ok @filmor :) |
It is worth trying, but I have neither time to do it nor a need for this. At the very least, you'll have to wait until 3.0 is released. |
This code works from Python:
But when compiled with Cython
--embed
, it fails:with:
Is this related to #941?
Is there a temporary or permanent fix for this?
Thanks!
A good idea would be to have an import function that can be called on
clr
namespace:that would not need to use the overridden
import
built-in function.The text was updated successfully, but these errors were encountered: