Giter VIP home page Giter VIP logo

pybind11_weaver's People

Contributors

edimetia3d avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

pybind11_weaver's Issues

Handling `T*` and `T&` of function parameter

When a function uses T* (or T & ) as a parameter, this function will usually want to modify the object it pointed to, e.g.

ErrorCode GetValue(int * v);
ErrorCode GetValue(std::vector<int> * vec);

However:

  1. Python itself does not support mutable int
  2. pybind11 will create a copy when T is a std container type, any modification to the copied object will not return to python runtime.

These cases should be handled automatically, or at least a warning should be printed.

This is still a developing project, not even alpha

Hi,

This project is still under development, the PyPI package and GitHub repo are both just placeholders.

I do have a full plan to re-implement it in an open-source way, but it may take some time.

whatever, the idea in the readme should be enough, it should be able to help you create your own generator that fits your needs.

Support generate docstrings

Doxygen style C++ document could be injected as docstring for exported entities.

  • docstring for enum item
  • docstring for function
  • docstring for class
  • docstring for method
  • docstring for public data member

Provide warnning when overloading with builtin types

Pybind11 intrinsically supports the binding of overloaded functions.

Nonetheless, several predicaments may arise:

  1. Pybind11 internally scrutinizes overloaded functions sequentially, employing the first viable function. Please refer to this Documentation for further details.
  2. Certain discrepancies exist between Python and C++ types, such as Python's bool being a subclass of int.

Consequently, when generating an overload solely reliant on the builtin type, potential complications could emerge. For instance:

Should you bind void Foo(int, float) prior to void Foo(bool, float), the Python call mod.foo(False, 8) would align with void Foo(int, float), a situation incongruous with the C++ overloading mechanism.

In the face of such circumstances, it would be prudent to issue appropriate warnings when generating binding code.

Code quality improvement

There should be some quality assurance:

  • Static code check, and fix errors, tools like MYPY and PyLint should be used
  • CI should be enabled, to enable auto testing/building/releasing
  • More tests should be added.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.