8000 Object identity, Interfaces and Attributes by rmadsen-ks · Pull Request #2019 · pythonnet/pythonnet · GitHub
[go: up one dir, main page]

Skip to content

Object identity, Interfaces and Attributes #2019

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

Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
1776 Inherit Generic Virtual Method Bug: Fix
Previously an exception was thrown during class creation if the python class inherited from a class with a virtual generic method.

This has been fixed by ignoring generic methods when creating overloads in the generated class. Note, this means that generic virtual methods cannot be overridden in python code.
  • Loading branch information
rmadsen-ks committed Oct 31, 2022
commit bfcf1d1b66f7d8d2d63989d506460713c91f8bf5
5 changes: 3 additions & 2 deletions src/runtime/Types/ClassDerived.cs
Original file line number Diff line number Diff line change
Expand Up @@ -219,8 +219,9 @@ internal static Type CreateDerivedType(string name,
var virtualMethods = new HashSet<string>();
foreach (MethodInfo method in methods)
{
if (!method.Attributes.HasFlag(MethodAttributes.Virtual) |
method.Attributes.HasFlag(MethodAttributes.Final))
if (!method.Attributes.HasFlag(MethodAttributes.Virtual)
|| method.Attributes.HasFlag(MethodAttributes.Final)
|| method.IsGenericMethod)
{
continue;
}
Expand Down
0