Visitar URL original
bpo-1635741: replace UCD_Check with Py_IS_TYPE by koubaa · Pull Request #22328 · python/cpython · GitHub
Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Update Modules/unicodedata.c
Co-authored-by: Victor Stinner <vstinner@python.org>
  • Loading branch information
koubaa and vstinner authored Sep 23, 2020
commit f09d3c23047866f30626728dac29a36ead0264e9
8 changes: 3 additions & 5 deletions Modules/unicodedata.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,9 @@ static PyMemberDef DB_members[] = {
/* forward declaration */
static PyTypeObject UCD_Type;

//check if self is of given type (which will be UCD_Type)
//UCD_Type is not in the macro because this will become a heap
//type and will need to be passed in. self is NULL when
//the PyCapsule API is used.
#define UCD_Check(self, type) self && Py_IS_TYPE(self, type)
// Check if self is an instance of UCD_Type.
// Return 0 if self is NULL (when the PyCapsule C API is used).
#define UCD_Check(self, ucd_type) (self != NULL && Py_IS_TYPE(self, ucd_type))

static PyObject*
new_previous_version(const char*name, const change_record* (*getrecord)(Py_UCS4),
Expand Down