Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

IComparable andIEquatable implementations#2322

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
lostmsu merged 1 commit intopythonnet:masterfromlosttech:ComparableEquatable
Feb 28, 2024

Conversation

lostmsu
Copy link
Member

@lostmsulostmsu commentedFeb 15, 2024
edited
Loading

IComparable andIEquatable implementations forPyInt,PyFloat, andPyString for primitive .NET types

What does this implement/fix? Explain your changes.

Let's one doPyInt.CompareTo(42) and similar things

Does this close any currently open issues?

N/A

Any other comments?

Should we take GIL in these methods? Might be useful forArray.Sort when called from Python.

On a more general topic: should we have a way for Python to call a .NET method and have it not release the GIL for compatibility with 3rd party (to Python.NET) libraries that assume they can call back any methods they wish at any time. Because having explicit GIL acquisition inCompareTo to use withArray.Sort would kill performance. E.g. something like:

withclr.HoldGIL():Array.Sort(dotnet_array_of_python_objects)

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 toAUTHORS
  • Updated theCHANGELOG

@lostmsulostmsu requested a review fromfilmorFebruary 27, 2024 03:14
@filmor
Copy link
Member

Regarding the GIL, maybe we could a custom thread local ref count could speed things up?

@lostmsulostmsuforce-pushed theComparableEquatable branch 2 times, most recently fromebab183 tof738505CompareFebruary 28, 2024 20:08
@lostmsulostmsu merged commit563e369 intopythonnet:masterFeb 28, 2024
@lostmsulostmsu deleted the ComparableEquatable branchFebruary 28, 2024 21:46
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@filmorfilmorfilmor approved these changes

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@lostmsu@filmor

[8]ページ先頭

©2009-2025 Movatter.jp