mapeditor/tiled

Modernize Python bindings

Open

#2190 aperta il 28 ago 2019

Vedi su GitHub
 (3 commenti) (0 reazioni) (0 assegnatari)C++ (1708 fork)batch import
help wanted

Metriche repository

Star
 (10.413 star)
Metriche merge PR
 (Merge medio 14g 4h) (17 PR mergiate in 30 g)

Descrizione

The current Python plugin relies on a large amount of generated code based on the somewhat hard to maintain and always incomplete tiledbinding.py and qtbinding.py.

I've recently learned about pybind11 (see also this blog post), which seems like a much nicer way of binding the classes to Python. The bindings are defined with similar verbosity, but directly in C++ which makes it easier to keep up-to-date.

In addition, pybind11 provides a more convenient way of interfacing with an embedded Python interpreter than using the Python API directly.

Guida contributor