Skip to content

Compilation error when trying to use sets #42

Closed
@bennybp

Description

@bennybp

When trying to convert set types, I get a compilation error:

pybind11/include/pybind11/stl.h:87:37: error: invalid conversion from ‘long int’ to ‘PyObject* {aka _object*}’ [-fpermissive]

The source seems to be these lines (starting at line 87):

if (PySet_Add(set, value) != 0) {
    Py_DECREF(value);
    Py_DECREF(set);
    return nullptr;

I think value on lines 87 and 88 should be value_, which is the PyObject * created on line 82:

PyObject *value_ = value_conv::cast(value, policy, parent);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions