Skip to content
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

[BUG]: stubgen definition order #876

Open
kcajf opened this issue Jan 22, 2025 · 1 comment
Open

[BUG]: stubgen definition order #876

kcajf opened this issue Jan 22, 2025 · 1 comment

Comments

@kcajf
Copy link

kcajf commented Jan 22, 2025

Problem description

I have an enum and a class defined in py nanobind module. The class references a value from the enum in one of its method's default arguments.

When I run nanobind.stubgen, the enum definition is output after the class, causing the enum type's name in the python default argument to be unknown (to the IDE). It seems that all the entries are sorted alphabetically, rather than retaining e.g. the sort order they are given in the C++ code.

Is this expected?

Reproducible example code


@wjakob
Copy link
Owner

wjakob commented Jan 29, 2025

Normally parsers of .pyi files don't care about the order. This is the case for MyPy and PyRight.

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

No branches or pull requests

2 participants