FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Add test for enum int conversion by filmor · Pull Request #1811 · pythonnet/pythonnet · GitHub

Add test for enum int conversion - #1811

Merged
filmor merged 1 commit into
masterfrom
enum-int
Jun 13, 2022
Merged

Add test for enum int conversion#1811
filmor merged 1 commit into
masterfrom
enum-int

Conversation

filmor commented Jun 9, 2022

Copy link
Copy Markdown
Member

What does this implement/fix? Explain your changes.

#1810

Does this close any currently open issues?

#1810

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
  • Ensure you have signed the .NET Foundation CLA
  • Add yourself to AUTHORS
  • Updated the CHANGELOG

Comment thread src/runtime/Util/OpsHelper.cs Outdated
Comment on lines +83 to +84
[ForbidPythonThreads]
#pragma warning disable IDE1006 // Naming Styles - must match Python
public static PyInt __int__(T value)
public static PyInt __int__(T value) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

The [ForbidPythonThreads] attribute should be ensuring that when this method is called, the calling thread holds GIL.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

It's the other way round, right? If this attribute is not given, the GIL is explicitly released. If for some reason it has been released before, it will not be taken here.

lostmsu Jun 9, 2022
edited
Loading

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

The point is: who and why releases GIL when this is called from Python?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

That's a great question, but in the end, the code here is wrong as ForbidPythonThreads does not take the GIL, right? After this one is merged, I'd declare the current master rc1 and start off a release-3.0 branch, ok?

lostmsu Jun 12, 2022
edited
Loading

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

@filmor you should take this fix instead. I actually addressed ignoring ForbidPythonThreads: losttech@025cc5c

filmor changed the title Take the GIL when converting enum to int Add test for enum int conversion Jun 13, 2022
filmor merged commit 43d1640 into master Jun 13, 2022
filmor deleted the enum-int branch June 13, 2022 13:34
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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.

2 participants


Back | FazBrowse Home | New Git URL