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

Remove non-existent PInvoke functions by amos402 · Pull Request #1205 · pythonnet/pythonnet · GitHub

Remove non-existent PInvoke functions - #1205

Merged
filmor merged 3 commits into
pythonnet:masterfrom
amos402:remove-deprecated-api
Aug 25, 2020
Merged

Remove non-existent PInvoke functions#1205
filmor merged 3 commits into
pythonnet:masterfrom
amos402:remove-deprecated-api

Conversation

amos402 commented Aug 19, 2020

Copy link
Copy Markdown
Member

What does this implement/fix? Explain your changes.

Deprecated Python2 API:

  • PyInstance_New
  • PyInstance_NewRaw

Mere macros on C side:

  • PyObject_CheckBuffer
  • PyObject_GC_New (refer to _PyObject_GC_New)

Check method:
https://gist.github.com/amos402/fb41571856bc77a2bada8056e429b312

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

Comment thread src/runtime/runtime.cs Outdated

[DllImport(_PythonDll, CallingConvention = CallingConvention.Cdecl)]
[DllImport(_PythonDll, CallingConvention = CallingConvention.Cdecl, EntryPoint = "_PyObject_GC_New")]
internal static extern IntPtr PyObject_GC_New(IntPtr tp);

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

Is this one used anywhere?

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

None.
Its implemetantion is

#define PyObject_GC_New(type, typeobj) \
                ( (type *) _PyObject_GC_New(typeobj) )

Just compare to the PyObject_CheckBuffer, it's easy to make it be a PInvoke function by specific the entry point.

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

If it's not used, just remove it.

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

Well, it's a not big deal though, but what's bad for declaring a valid api?

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

If we don't use it, it should not be included. The fewer functions we refer to, the easier it will be to keep compatible with different Python versions from the same DLL.

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 point, although I don't think this API will be deleted in the future.
Removed it.

codecov-commenter commented Aug 24, 2020
edited
Loading

Copy link
Copy Markdown

Codecov Report

Merging #1205 into master will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master    #1205   +/-   ##
=======================================
  Coverage   86.25%   86.25%           
=======================================
  Files           1        1           
  Lines         291      291           
=======================================
  Hits          251      251           
  Misses         40       40           
Flag Coverage Δ
#setup_linux 64.94% <ø> (ø)
#setup_windows 72.50% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.


Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 29978d8...b07d1ca. Read the comment docs.

filmor merged commit 61d1b7c into pythonnet:master Aug 25, 2020
amos402 deleted the remove-deprecated-api branch August 31, 2020 04:06
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.

3 participants


Back | FazBrowse Home | New Git URL