Thanks to visit codestin.com
Credit goes to github.com

Skip to content

merge master #1

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

Open
wants to merge 435 commits into
base: master
Choose a base branch
from
Open

merge master #1

wants to merge 435 commits into from

Conversation

MarioBeretta
Copy link
Owner

What does this implement/fix? Explain your changes.

...

Does this close any currently open issues?

...

Any other comments?

...

Checklist

Check all those that are applicable and complete.

  • Make sure to include one or more tests for your change
  • If an enhancement PR, please create docs and at best an example
  • Add yourself to AUTHORS
  • Updated the CHANGELOG

lostmsu and others added 30 commits November 25, 2021 12:17
remote analyzer workaround
Update NonCopyableAnalyzer to latest version with our changes upstreamed
Reworked `ManagedType` to not keep python references to self
Use new references; redesign ManagedType to not hold Python references
mostly nullability annotations

removed a little bit of dead code
Before `pythonnet` 3.0 is finally released, we should bump clr-loader to 1.0.
CPython uses a bare `enum` here, both of .NET and C default to `int`
enums, so this should be closer to the truth if no special compile
options are used.
Also makes the type names a bit more Python-esque. The `clr._internal`
module doesn't exist, but that is no difference to the previous setup.
… is an equivalent of `ShutdownMode.Reload`

also in this change:
- fixed Python derived types not being decrefed when an instance is deallocated
- reduced time and amount of storage needed for runtime reload
- removed circular reference loop between Type <-> ConstructorBinding(s)
+ exposed Runtime.TryCollectingGarbage
clearing GCHandle from an instance of Python derived type would drop the last reference to it, so it was destroyed without being removed from reflectedObjects collection
…etMethod would not return base non-overriden accessor for a partially overriden property

because of that when constructing PropertyObject we scan base classes to find base accessor (if any)

this might have performance implications due to replacement of PropertyInfo.GetValue with getter.Invoke (not tested)

fixes #1455
was: tp_new implementation would call .NET constructor and return a fully constructed object

now:
Except for some special .NET types tp_new creates uninitialized .NET object, which is later initialized by calling __init__.

__init__ is set using type dictionary to a MethodObject, that contains ConstructorInfo[] instead of MethodInfo[]

This allows Python to:
1) freely override __init__
2) when deriving from .NET types call base __init__ (e.g. .NET constructor), and choose the overload as needed

fixes #238
Prior to this change if method had multiple generic overloads, only 1 of them could be matched (whichever one reflection would return first)

Now MethodBinder.MatchParameters returns all matching generic overloads, not just the first one.

fixes #1522
lostmsu and others added 30 commits July 2, 2024 08:13
…or some other internal errors (#2409)

* not all events have Add method

fixes #2405

* give users some idea of why we might be unable to reflect .NET types to Python for them

* mentioned event Add method crash fix in changelog
Otherwise if you have a Python object that needs to temporarily create a .NET object in its destructor (for instance write log summary to a file), its destructor will fail if it happens to be freed on the second iteration of loop breaking.
Fix access violation exception on shutdown
Was only used in the console and might not be available in some
embedding scenarios.
Verified them locally, but there is an issue with the Github workflow
image that can hopefully be resolved later by using a full venv
instead of relying on the system environment.
fixed crash for all other types (now properly throws TypeError)

fixes #2530
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.