Skip to content

skip signature degrading #38

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

Closed
ixje opened this issue Aug 27, 2020 · 6 comments · Fixed by #39
Closed

skip signature degrading #38

ixje opened this issue Aug 27, 2020 · 6 comments · Fixed by #39
Assignees
Labels
enhancement New feature or request

Comments

@ixje
Copy link
Contributor

ixje commented Aug 27, 2020

I just upgraded to 0.6.2 and am now facing something like this

[2020-08-27 11:14:21,239] {__init__.py:55} ERROR - Generated stubs signature is degraded to `(*args, **kwargs) -> Any` for
[2020-08-27 11:14:21,240] {__init__.py:56} ERROR - def __init__(self: neo3vm.ArrayStackItem, reference_counter: neo3vm::ReferenceCounter) -> None: pass
[2020-08-27 11:14:21,240] {__init__.py:57} ERROR -                                                                    ^-- Invalid syntax

The general idea is cool, but it would be nice if there is a cli flag to skip this downgrading. For example I do a second pass on the generates stubs to fix these myself.

@sizmailov sizmailov self-assigned this Aug 27, 2020
@sizmailov sizmailov added the enhancement New feature or request label Aug 27, 2020
@sizmailov
Copy link
Owner

Hi! The errors should motivate people to fix/report original binding code problems.

I see the extra flag as ad-hoc solution for those who generate stubs for 3rd-party libraries.

@ixje
Copy link
Contributor Author

ixje commented Aug 27, 2020

I see the extra flag as ad-hoc solution for those who generate stubs for 3rd-party libraries.

Fair assessment. Note that it is unclear to me if you're open to adding this flag?
I think it can be valuable if the library author isn't willing to provide stubs or is not willing to fix his bindings by way of creating forward references.

@sizmailov
Copy link
Owner

I'll merge it in a minute with a minor changes. I want to add a handy link to pybind11 doc/issue which would describe the problem with C++ signatures in docstrings.

@sizmailov
Copy link
Owner

Ok, such issue / docs paragraph does not exist (yet), can add it later.

@ixje
Copy link
Contributor Author

ixje commented Aug 27, 2020

@sizmailov fwiw; I think this issue describes it pybind/pybind11#2263

@sizmailov
Copy link
Owner

The "forward declaration" technique in Yannick's comment is quite useful. I use it all over the place. This example should be in pybind11 docs though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants