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

Try to be strict around non-copyability by filmor · Pull Request #2440 · pythonnet/pythonnet · GitHub

Repository navigation

Try to be strict around non-copyability - #2440

Open
filmor wants to merge 1 commit into
masterfrom
noncopyableanalyzer
Open

filmor wants to merge 1 commit into
masterfrom
noncopyableanalyzer

Conversation

filmor commented Aug 22, 2024

Copy link
Copy Markdown
Member

No description provided.

public double ToDouble() => Runtime.PyFloat_AsDouble(obj);

public override TypeCode GetTypeCode() => TypeCode.Double;
public override int GetHashCode() => ((PyObject)this).GetHashCode();

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

This looks like it would just stackoverflow

}

public override TypeCode GetTypeCode() => TypeCode.Int64;
public override int GetHashCode() => ((PyObject)this).GetHashCode();

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

Same

Comment on lines +86 to +87
var free = (delegate* unmanaged[Cdecl]<ref StolenReference, void>)freePtr;
free(ref ob);

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

I think this is wrong. It does not say anywhere but I'd expect tp_free to take a reference to PyObject (e.g. PyObject*), not a reference to reference to it (e.g. not a PyObject**).

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

Ah, that's probably one reason for the crashes :)

lostmsu commented Apr 11, 2025

Copy link
Copy Markdown
Member

Seems abandoned - requested changes not addressed.

lostmsu closed this Apr 11, 2025

filmor commented Apr 14, 2025

Copy link
Copy Markdown
Member Author

Not abandoned, just very low priority. We have to fix these warnings eventually, they are extremely spammy and the non-copyability check is borderline useless right now. Either we fix things or we drop the analyzer until an official one is added.

filmor reopened this Apr 14, 2025

This branch has not been deployed

No deployments
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