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

C API: Add replacements for PyObject_HasAttr() etc #108511

Closed
Labels
@serhiy-storchaka

Description

@serhiy-storchaka

Feature or enhancement

Has this already been discussed elsewhere?

No response given

Links to previous discussion of this feature:

#75753
#106672

Proposal:

FunctionsPyDict_GetItem(),PyDict_GetItemString(),PyMapping_HasKey(),PyMapping_HasKeyString(),PyObject_HasAttr(),PyObject_HasAttrString() andPySys_GetObject() have a flaw -- they clear any error raised inside the function, including important and critical errors. They cannot be fixed, because the user code which use them do not handle errors. There are replacements free from this flaw forPyDict_GetItem() (PyDict_GetItemWithError() andPyDict_GetItemRef()) and, in some applications, toPyDict_GetItemString() (PyDict_GetItemRefString()).

We need new functions similar toPyMapping_HasKey(),PyMapping_HasKeyString(),PyObject_HasAttr(),PyObject_HasAttrString() which return three-state value (1 - yes,0 -- no, and-1 --error). What should be their names? Add theWithError suffix? Add theEx sufix? Add the2 suffix?

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp