-
-
Notifications
You must be signed in to change notification settings - Fork 32k
bpo-35134: Add Include/cpython/descrobject.h
Move Include/descrobject.h non-limited API to a new Include/cpython/descrobject.h header file.
- Loading branch information
commit c25eb38d6ae507c44b591ea103b1f654f0e89b11
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
#ifndef Py_CPYTHON_DESCROBJECT_H | ||
# error "this header file must not be included directly" | ||
#endif | ||
|
||
typedef PyObject *(*wrapperfunc)(PyObject *self, PyObject *args, | ||
void *wrapped); | ||
|
||
typedef PyObject *(*wrapperfunc_kwds)(PyObject *self, PyObject *args, | ||
void *wrapped, PyObject *kwds); | ||
|
||
struct wrapperbase { | ||
const char *name; | ||
int offset; | ||
void *function; | ||
wrapperfunc wrapper; | ||
const char *doc; | ||
int flags; | ||
PyObject *name_strobj; | ||
}; | ||
|
||
/* Flags for above struct */ | ||
#define PyWrapperFlag_KEYWORDS 1 /* wrapper function takes keyword args */ | ||
|
||
/* Various kinds of descriptor objects */ | ||
|
||
typedef struct { | ||
PyObject_HEAD | ||
PyTypeObject *d_type; | ||
PyObject *d_name; | ||
PyObject *d_qualname; | ||
} PyDescrObject; | ||
|
||
#define PyDescr_COMMON PyDescrObject d_common | ||
|
||
#define PyDescr_TYPE(x) (((PyDescrObject *)(x))->d_type) | ||
#define PyDescr_NAME(x) (((PyDescrObject *)(x))->d_name) | ||
|
||
typedef struct { | ||
PyDescr_COMMON; | ||
PyMethodDef *d_method; | ||
vectorcallfunc vectorcall; | ||
} PyMethodDescrObject; | ||
|
||
typedef struct { | ||
PyDescr_COMMON; | ||
struct PyMemberDef *d_member; | ||
} PyMemberDescrObject; | ||
|
||
typedef struct { | ||
PyDescr_COMMON; | ||
PyGetSetDef *d_getset; | ||
} PyGetSetDescrObject; | ||
|
||
typedef struct { | ||
PyDescr_COMMON; | ||
struct wrapperbase *d_base; | ||
void *d_wrapped; /* This can be any function pointer */ | ||
} PyWrapperDescrObject; | ||
|
||
PyAPI_DATA(PyTypeObject) _PyMethodWrapper_Type; | ||
|
||
PyAPI_FUNC(PyObject *) PyDescr_NewWrapper(PyTypeObject *, | ||
struct wrapperbase *, void *); | ||
PyAPI_FUNC(int) PyDescr_IsData(PyObject *); |
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
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
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
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
bpo-35134: Add Include/cpython/descrobject.h #30923
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uh oh!
There was an error while loading. Please reload this page.
bpo-35134: Add Include/cpython/descrobject.h #30923
Changes from all commits
c25eb38
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.