Skip to content

Add note about specifying custom base class for Exceptions.#2465

Merged
YannickJadoul merged 3 commits into
pybind:masterfrom
michalsustr:master
Sep 6, 2020
Merged

Add note about specifying custom base class for Exceptions.#2465
YannickJadoul merged 3 commits into
pybind:masterfrom
michalsustr:master

Conversation

@michalsustr

Copy link
Copy Markdown
Contributor

No description provided.

@YannickJadoul YannickJadoul left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks, @michalsustr! A few minor remarks, but good to have this documented :-)

into Python exceptions of type ``PyExp``.

It is possible to specify base class for the exception using the third
parameter, a pointer to `PyObject`:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I know this is currently correct, but do we have any idea why this isn't a handle?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

No idea, first time contributing to pybind.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

No problem. Let's see if @bstaletic or anyone else knows! :-)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Nope, no clue other than "the source says so".

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

OK, let's maybe change this in a different PR, then? (Actually, we might even change this to py::type, @henryiii?)

Comment thread docs/advanced/exceptions.rst Outdated
Comment thread docs/advanced/exceptions.rst

@YannickJadoul YannickJadoul left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks good to me, once the CI gets fixed! :-)

Comment thread docs/advanced/exceptions.rst Outdated

@bstaletic bstaletic left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks good.

into Python exceptions of type ``PyExp``.

It is possible to specify base class for the exception using the third
parameter, a pointer to `PyObject`:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Nope, no clue other than "the source says so".

@YannickJadoul

Copy link
Copy Markdown
Collaborator

No further comments, it seems, so let's merge. (If anyone still has remarks, afterwards, it's just docs and easy enough to change.)

@YannickJadoul YannickJadoul merged commit 3bd0d7a into pybind:master Sep 6, 2020
@YannickJadoul

Copy link
Copy Markdown
Collaborator

Thanks again, @michalsustr!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants