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

Remove non-existent PInvoke functions#1205

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
filmor merged 3 commits intopythonnet:masterfromamos402:remove-deprecated-api
Aug 25, 2020

Conversation

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

@@ -1793,7 +1784,7 @@ internal static IntPtr PyType_GenericAlloc(IntPtr type, long n)
[DllImport(_PythonDll, CallingConvention = CallingConvention.Cdecl)]
internal static extern IntPtr _PyObject_GetDictPtr(IntPtr obj);

[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
Member

Choose a reason for hiding this comment

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

Is this one used anywhere?

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

None.
Its implemetantion is

#definePyObject_GC_New(type,typeobj) \                ( (type *) _PyObject_GC_New(typeobj) )

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

Copy link
Member

Choose a reason for hiding this comment

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

If it's not used, just remove it.

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

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

Copy link
Member

Choose a reason for hiding this comment

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

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
MemberAuthor

Choose a reason for hiding this comment

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

That's a point, although I don't think this API will be deleted in the future.
Removed it.

@codecov-commenter
Copy link

codecov-commenter commentedAug 24, 2020
edited
Loading

Codecov Report

Merging#1205 intomaster willnot change coverage.
The diff coverage isn/a.

Impacted file tree graph

@@           Coverage Diff           @@##           master    #1205   +/-   ##=======================================  Coverage   86.25%   86.25%           =======================================  Files           1        1             Lines         291      291           =======================================  Hits          251      251             Misses         40       40
FlagCoverage Δ
#setup_linux64.94% <ø> (ø)
#setup_windows72.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 byCodecov. Last update29978d8...b07d1ca. Read thecomment docs.

@filmorfilmor merged commit61d1b7c intopythonnet:masterAug 25, 2020
@amos402amos402 deleted the remove-deprecated-api branchAugust 31, 2020 04:06
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@filmorfilmorfilmor left review comments

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

Successfully merging this pull request may close these issues.

3 participants
@amos402@codecov-commenter@filmor

[8]ページ先頭

©2009-2025 Movatter.jp