Closed daltairwalter closed 2 years ago
The future annotations feature seems to work for this too. This seems better then the quote option.
from future import annotations
apparently I missed a code identifier
from __future__ import annotations
Note that pybind11-stubgen
does not perform analysis of the modules, it's rather simple tool.
Although pybind11-stubgen
does it's best to avoid such problems by reordering generated stubs, but it can fail if reordering won't help. I think optional quotation might be right solution to the problem:
Option 1. Quote everything triggered by --annotations-as-strings
Option 2. Quote only listed items, e.g. --annotate-as-string=UserDefinedRegistrationInformation
Closed by f9dd91836e5acc37a4eb272c3c173ed3287eecc9
I am renaming the output files to be module.py in an attempt to use pylint. This mostly works, but I see some errors when there are forward declarations.
pyi def registerUserDefinedAlgorithm(self, arg0: UserDefinedRegistrationInformation) -> None: ...
The error goes away if I add quotes like this: def registerUserDefinedAlgorithm(self, arg0: 'UserDefinedRegistrationInformation') -> None: ...
pylint error [E0601(used-before-assignment)Factory.registerUserDefinedAlgorithm] Using variable 'UserDefinedRegistrationInformation' before assignment