Comments (6)
Could you give more details on how this could be implemented?
from pythonnet.
I've not really looked in too much detail I'm afraid, but I was thinking that if tp_bases on the type structure was set to a tuple of base classes, including the interfaces, then that would make isinstance work. From memory, I think currently tp_base is set and tp_bases is set to NULL.
from pythonnet.
Looking a bit deeper into this, I think this should be implemented in the metaclass instead, by means of __instancecheck__
(works only from 2.6 onwards, but that should be enough). If you add the interfaces to tp_bases
it will fail on method resolution as "mro() returned base class with unsuitable layout"
. In the end, the interfaces aren't really base classes anyway.
from pythonnet.
@filmor is this now implemented in your pull request here?
from pythonnet.
Yep, it is.
from pythonnet.
Fixed in #167.
from pythonnet.
Related Issues (20)
- Issues while trying to use Virtual Environment HOT 3
- HELP... cannot get CLR to run on Linux server: RuntimeError: Failed to create a .NET runtime (coreclr) using the parameters {}. HOT 1
- Possible causes for ModuleNotFoundError with .NET Framework DLL.
- Support for creating python sub-interpreters
- System.NotSupportedException: BinaryFormatter serialization and deserialization are disabled within this application
- pythonnet throws error while import library in conda environment
- DllNotFoundException on .net 6 with python 3.12
- Is Pythonnet compatible running within a .pyz (zipapp)? HOT 1
- calling a python library for Windows desktop automation over a .net Console Application
- Unable to capture `Console.Error` messages written in C# using `redirect_stderr` in Python
- Unhandled Exception when exiting from nPython.exe (net472) HOT 1
- clr is not being imported properly HOT 2
- Python.Runtime.PythonException: ImportError: DLL load failed: 文件名或拓展名太长。
- Script not executing properly in embedded Python in .NET application HOT 3
- Getting exception when calling PythonEngine.Initialize() second time after shutdown HOT 2
- Cannot import win32api from pywin32 when running pythonnet in a c#/.NET runtime HOT 2
- PythonNET unknown kwargs being discarded
- Signal.py error in Linux HOT 1
- Failed to load 'System.Windows.Forms.dll' on .net8 HOT 1
- how to use the .net8 in python to run the C# assembly?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pythonnet.