Comments (2)
I think bare py::module::import("mytype")
should produce and import statement, while the next one should for sure:
m.add_object("itertools", py::module::import("itertools"));
Same applies when attribute type is a type from imported module.
from pybind11-stubgen.
Attached an extension from my example, no import on test_demo_import is generated in test_demo
python.zip
i think test_demo_import should be imported in the test_demo.pyi
from pybind11-stubgen.
Related Issues (20)
- Error message only references type, not specific function HOT 1
- typing.Annotated in a version of python that doesn't support it HOT 2
- enum warning doesn't tell you where it's coming from HOT 5
- buffer type broken by #168 HOT 10
- submodule imports don't resolve HOT 5
- pybind11::dtype
- Option to translate pointers to `PointedType | None` HOT 1
- Failing to fully resolve classes? HOT 6
- Fully-qualified type name is not shortend in nested annotation
- Option to use TypeVars for numpy.ndarray's shape type argument HOT 2
- Using `KeysView`/`ValuesView`/`ItemsView` across sub modules can result in "can't find/import" error HOT 2
- Allow replacing `...` by `object` / `Any` / `Incomplete`? HOT 10
- Modify Enum keyword default from its __repr__ to its __str__ by default? HOT 2
- Missing wheels for newer releases HOT 2
- On using `pybind11_stubgen`-defined classes in generated stubs HOT 2
- Where to store the generated stubs? HOT 4
- KeyError: 'pop from an empty set' HOT 4
- Automatically replace invalid enum expressions with corresponding valid expression & import
- Make an interface for post-parser fixup
- Enum with custom `__str__` results in non-type-checkable stub
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pybind11-stubgen.